20 buildPythonPackage rec {
23 format = "setuptools";
25 disabled = pythonOlder "3.7";
27 src = fetchFromGitHub {
30 rev = "refs/tags/${version}";
31 # Upstream uses versioneer, which relies on git attributes substitution.
32 # This leads to non-reproducible archives on github. Remove the substituted
33 # file here, and recreate it later based on our version info.
35 rm "$out/limits/_version.py"
37 hash = "sha256-VLfFWFcwLgEEvPUKQ00QjEq1HN28OpE6Eu1eyF+TwXU=";
40 propagatedBuildInputs = [
60 substituteInPlace pytest.ini \
61 --replace "--cov=limits" "" \
64 substituteInPlace setup.py \
65 --replace "versioneer.get_version()" "'${version}'"
67 # Recreate _version.py, deleted at fetch time due to non-reproducibility.
68 echo 'def get_versions(): return {"version": "${version}"}' > limits/_version.py
71 pythonImportsCheck = [
76 # All other tests require a running Docker instance
77 "tests/test_limits.py"
78 "tests/test_ratelimit_parser.py"
79 "tests/test_limit_granularities.py"
83 description = "Rate limiting using various strategies and storage backends such as redis & memcached";
84 homepage = "https://github.com/alisaifee/limits";
85 license = licenses.mit;
86 maintainers = with maintainers; [ ];