From a14a3f1e3c66e93b9403d3fd9dd38b099e1574db Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 16 Feb 2022 10:06:32 +0100 Subject: [PATCH 1/3] python3Packages.limits: enable tests --- .../python-modules/limits/default.nix | 62 ++++++++++++++++--- 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/limits/default.nix b/pkgs/development/python-modules/limits/default.nix index 7cb622df047e..ba31679ebac3 100644 --- a/pkgs/development/python-modules/limits/default.nix +++ b/pkgs/development/python-modules/limits/default.nix @@ -1,21 +1,69 @@ -{ lib, fetchPypi, buildPythonPackage, six }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, hiro +, pymemcache +, pymongo +, pytest-asyncio +, pytest-lazy-fixture +, pytestCheckHook +, pythonOlder +, redis +, setuptools +}: buildPythonPackage rec { pname = "limits"; version = "2.4.0"; + format = "setuptools"; - src = fetchPypi { - inherit pname version; - sha256 = "sha256-jiK2PfJjECB6d7db1HRZnwpGE6fZFjZQ7TpCjpzHrjU="; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "alisaifee"; + repo = pname; + rev = version; + hash = "sha256-KSYcIdLQ6TZpimxXyV88/V35GbBJ/9k9+UBM2KTMRR4="; }; - propagatedBuildInputs = [ six ]; + propagatedBuildInputs = [ + setuptools + redis + pymemcache + pymongo + ]; - doCheck = false; # ifilter + checkInputs = [ + hiro + pytest-asyncio + pytest-lazy-fixture + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pytest.ini \ + --replace "--cov=limits" "" \ + --replace "-K" "" + # redis-py-cluster doesn't support redis > 4 + substituteInPlace tests/conftest.py \ + --replace "import rediscluster" "" + ''; + + pythonImportsCheck = [ + "limits" + ]; + + pytestFlagsArray = [ + # All other tests require a running Docker instance + "tests/test_limits.py" + "tests/test_ratelimit_parser.py" + "tests/test_limit_granularities.py" + ]; meta = with lib; { description = "Rate limiting utilities"; - license = licenses.mit; homepage = "https://limits.readthedocs.org/"; + license = licenses.mit; + maintainers = with maintainers; [ ]; }; } From 22f5d327101dbf13c072761417f460ed413725e8 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 27 Apr 2022 00:17:40 +0200 Subject: [PATCH 2/3] python39Packages.limits: 2.4.0 -> 2.6.1 --- pkgs/development/python-modules/limits/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/limits/default.nix b/pkgs/development/python-modules/limits/default.nix index ba31679ebac3..451bcb4466a1 100644 --- a/pkgs/development/python-modules/limits/default.nix +++ b/pkgs/development/python-modules/limits/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "limits"; - version = "2.4.0"; + version = "2.6.1"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -23,7 +23,7 @@ buildPythonPackage rec { owner = "alisaifee"; repo = pname; rev = version; - hash = "sha256-KSYcIdLQ6TZpimxXyV88/V35GbBJ/9k9+UBM2KTMRR4="; + hash = "sha256-4Njai0LT72U9Ra4pgHU0ZjF9oZexbijUgLFYaZi/LgE="; }; propagatedBuildInputs = [ From 1c4be4e27174812a00531521adeb323a414d31ee Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 29 Apr 2022 00:40:23 +0200 Subject: [PATCH 3/3] python310Packages.limits: remove extra requirements --- pkgs/development/python-modules/limits/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/limits/default.nix b/pkgs/development/python-modules/limits/default.nix index 451bcb4466a1..e99c23a79f4f 100644 --- a/pkgs/development/python-modules/limits/default.nix +++ b/pkgs/development/python-modules/limits/default.nix @@ -1,7 +1,9 @@ { lib , buildPythonPackage +, deprecated , fetchFromGitHub , hiro +, packaging , pymemcache , pymongo , pytest-asyncio @@ -10,6 +12,7 @@ , pythonOlder , redis , setuptools +, typing-extensions }: buildPythonPackage rec { @@ -27,17 +30,20 @@ buildPythonPackage rec { }; propagatedBuildInputs = [ + deprecated + packaging setuptools - redis - pymemcache - pymongo + typing-extensions ]; checkInputs = [ hiro + pymemcache + pymongo pytest-asyncio pytest-lazy-fixture pytestCheckHook + redis ]; postPatch = ''