nixpkgs/pkgs/development/python-modules/token-bucket/default.nix
Robert Schütz 1a04744f74 treewide: remove superfluous disabled
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:

    pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
    for f in $(find -name '*.nix'); do
        grep -q "$pattern" "$f" || continue
        sed -i "/$pattern/d" "$f"
        if [ $(grep -c pythonOlder "$f") == 1 ]; then
            sed -i '/^\s*pythonOlder,\s*$/d' "$f"
        fi
        nixfmt "$f"
    done
2026-01-11 09:34:20 -08:00

50 lines
1.2 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
pytestCheckHook,
setuptools,
}:
buildPythonPackage rec {
pname = "token-bucket";
version = "0.3.0";
pyproject = true;
src = fetchFromGitHub {
owner = "falconry";
repo = "token-bucket";
tag = version;
hash = "sha256-dazqJRpC8FUHOhgKFzDnIl5CT2L74J2o2Hsm0IQf4Cg=";
};
patches = [
# Replace imp with importlib, https://github.com/falconry/token-bucket/pull/24
(fetchpatch {
name = "remove-imp.patch";
url = "https://github.com/falconry/token-bucket/commit/10a3c9f4de00f4933349f66b4c72b6c96db6e766.patch";
hash = "sha256-Hk5+i3xzeA3F1kXRaRarWT9mff2lT2WNmTfTZvYzGYI=";
})
];
postPatch = ''
substituteInPlace setup.py \
--replace "'pytest-runner'" ""
'';
nativeBuildInputs = [ setuptools ];
nativeCheckInputs = [ pytestCheckHook ];
doCheck = !stdenv.hostPlatform.isDarwin;
meta = {
description = "Token Bucket Implementation for Python Web Apps";
homepage = "https://github.com/falconry/token-bucket";
changelog = "https://github.com/falconry/token-bucket/releases/tag/${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ hexa ];
};
}