From 011f0b78973b7f48f5b743fa86fe76fb43c32e53 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 27 Feb 2021 16:49:31 +0100 Subject: [PATCH 1/8] python3Packages.pymemcache: init at 3.4.0 --- .../python-modules/pymemcache/default.nix | 43 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/pymemcache/default.nix diff --git a/pkgs/development/python-modules/pymemcache/default.nix b/pkgs/development/python-modules/pymemcache/default.nix new file mode 100644 index 000000000000..d0089e8edbe6 --- /dev/null +++ b/pkgs/development/python-modules/pymemcache/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, future +, mock +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pymemcache"; + version = "3.4.0"; + + src = fetchFromGitHub { + owner = "pinterest"; + repo = pname; + rev = "v${version}"; + sha256 = "0xkw76y4059jg2a902wlpk6psyh2g4x6j6vlj9gzd5vqb7ihg2y7"; + }; + + checkInputs = [ + future + mock + pytestCheckHook + ]; + + postPatch = '' + sed -i "/--cov/d" setup.cfg + ''; + + disabledTests = [ + # python-memcached is not available (last release in 2017) + "TestClientSocketConnect" + ]; + + pythonImportsCheck = [ "pymemcache" ]; + + meta = with lib; { + description = "Python memcached client"; + homepage = "https://pymemcache.readthedocs.io/"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3503c37f5e71..3ba1df2a198f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5956,6 +5956,8 @@ in { pymeeus = callPackage ../development/python-modules/pymeeus { }; + pymemcache = callPackage ../development/python-modules/pymemcache { }; + pymemoize = callPackage ../development/python-modules/pymemoize { }; pyment = callPackage ../development/python-modules/pyment { }; From 7bb0f30b7f92ec2271bfa5dc763ba663c9137188 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 27 Feb 2021 16:58:20 +0100 Subject: [PATCH 2/8] python3Packages.flask-limiter: enable tests --- pkgs/development/python-modules/python-awair/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/python-awair/default.nix b/pkgs/development/python-modules/python-awair/default.nix index 8489247399a5..b676a7a3de98 100644 --- a/pkgs/development/python-modules/python-awair/default.nix +++ b/pkgs/development/python-modules/python-awair/default.nix @@ -2,7 +2,7 @@ , aiohttp , buildPythonPackage , fetchFromGitHub -, poetry +, poetry-core , pytest-aiohttp , pytestCheckHook , pythonOlder @@ -12,7 +12,7 @@ buildPythonPackage rec { pname = "python-awair"; - version = "0.2.1"; + version = "0.2.2"; format = "pyproject"; disabled = pythonOlder "3.6"; @@ -20,10 +20,10 @@ buildPythonPackage rec { owner = "ahayworth"; repo = "python_awair"; rev = version; - sha256 = "1fqjigc1a0lr9q6bjjq3j8pa39wg1cbkb0l67w94a0i4dkdfri8r"; + sha256 = "sha256-5+s1aSvt+rXyumvf/qZ58Uvmq0p45mu23Djbwgih3qI="; }; - nativeBuildInputs = [ poetry ]; + nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ aiohttp From 622743709a74424043a19b0f0fe49289146a538d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 27 Feb 2021 17:00:42 +0100 Subject: [PATCH 3/8] python3Packages.python-awair: 0.2.1 -> 0.2.2 --- .../python-modules/flask-limiter/default.nix | 52 +++++++++++++++++-- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/flask-limiter/default.nix b/pkgs/development/python-modules/flask-limiter/default.nix index d22096f91494..418225550167 100644 --- a/pkgs/development/python-modules/flask-limiter/default.nix +++ b/pkgs/development/python-modules/flask-limiter/default.nix @@ -1,16 +1,60 @@ -{ lib, fetchPypi, buildPythonPackage, flask, limits }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, flask +, flask-restful +, hiro +, limits +, mock +, ordereddict +, pymemcache +, pytestCheckHook +, redis +}: buildPythonPackage rec { pname = "Flask-Limiter"; version = "1.4"; - src = fetchPypi { - inherit pname version; - sha256 = "021279c905a1e24f181377ab3be711be7541734b494f4e6db2b8edeba7601e48"; + src = fetchFromGitHub { + owner = "alisaifee"; + repo = "flask-limiter"; + rev = version; + sha256 = "1k1b4b3s1acphqnar0y5g747bh1y7w35gcl5g819idq2a5vqnass"; }; propagatedBuildInputs = [ flask limits ]; + checkInputs = [ + pytestCheckHook + hiro + mock + redis + flask-restful + pymemcache + ordereddict + ]; + + postPatch = '' + sed -i "/--cov/d" pytest.ini + ''; + + # Some tests requires a local Redis instance + disabledTests = [ + "test_fallback_to_memory" + "test_reset_unsupported" + "test_constructor_arguments_over_config" + "test_fallback_to_memory_config" + "test_fallback_to_memory_backoff_check" + "test_fallback_to_memory_with_global_override" + "test_custom_key_prefix" + "test_redis_request_slower_than_fixed_window" + "test_redis_request_slower_than_moving_window" + "test_custom_key_prefix_with_headers" + ]; + + pythonImportsCheck = [ "flask_limiter" ]; + meta = with lib; { description = "Rate limiting for flask applications"; homepage = "https://flask-limiter.readthedocs.org/"; From 33f9e54720d8d04bc12ed41d5e0bf29688971fd6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 2 Apr 2021 11:14:00 +0200 Subject: [PATCH 4/8] python3Packages.docloud: fix build --- pkgs/development/python-modules/docloud/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/docloud/default.nix b/pkgs/development/python-modules/docloud/default.nix index f1ec269f7cbb..2c92b32c748c 100644 --- a/pkgs/development/python-modules/docloud/default.nix +++ b/pkgs/development/python-modules/docloud/default.nix @@ -2,6 +2,7 @@ , buildPythonPackage , fetchPypi , requests +, six }: buildPythonPackage rec { @@ -15,6 +16,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ requests + six ]; # Pypi's tarball doesn't contain tests. Source not available. From 1ccbd15b10220f51f9821d200a8c31425927b269 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 2 Apr 2021 11:39:16 +0200 Subject: [PATCH 5/8] python3Packages.ntlm-auth: fix build --- .../python-modules/ntlm-auth/default.nix | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/ntlm-auth/default.nix b/pkgs/development/python-modules/ntlm-auth/default.nix index 080734bd25e8..d56fccde051d 100644 --- a/pkgs/development/python-modules/ntlm-auth/default.nix +++ b/pkgs/development/python-modules/ntlm-auth/default.nix @@ -1,10 +1,10 @@ { lib , buildPythonPackage +, cryptography , fetchFromGitHub , mock -, pytest +, pytestCheckHook , requests -, unittest2 , six }: @@ -19,13 +19,18 @@ buildPythonPackage rec { sha256 = "00dpf5bfsy07frsjihv1k10zmwcyq4bvkilbxha7h6nlwpcm2409"; }; - checkInputs = [ mock pytest requests unittest2 ]; - propagatedBuildInputs = [ six ]; + propagatedBuildInputs = [ + cryptography + six + ]; - # Functional tests require networking - checkPhase = '' - py.test --ignore=tests/functional/test_iis.py - ''; + checkInputs = [ + mock + pytestCheckHook + requests + ]; + + pythonImportsCheck = [ "ntlm_auth" ]; meta = with lib; { description = "Calculates NTLM Authentication codes"; From 7e656901657741394fec75905c3cb11ffc7e269e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 2 Apr 2021 11:46:47 +0200 Subject: [PATCH 6/8] python3Packages.requests-kerberos: fix build --- .../requests-kerberos/default.nix | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/requests-kerberos/default.nix b/pkgs/development/python-modules/requests-kerberos/default.nix index 73272990e0f2..0a023dab8714 100644 --- a/pkgs/development/python-modules/requests-kerberos/default.nix +++ b/pkgs/development/python-modules/requests-kerberos/default.nix @@ -1,4 +1,12 @@ -{ lib, fetchFromGitHub, buildPythonPackage, requests, pykerberos, mock }: +{ lib +, fetchFromGitHub +, buildPythonPackage +, cryptography +, requests +, pykerberos +, pytestCheckHook +, mock +}: buildPythonPackage rec { pname = "requests-kerberos"; @@ -12,16 +20,26 @@ buildPythonPackage rec { sha256 = "1qw96aw84nljh9cip372mfv50p1yyirfgigavvavgpc3c5g278s6"; }; - checkInputs = [ mock ]; - propagatedBuildInputs = [ requests pykerberos ]; + propagatedBuildInputs = [ + cryptography + requests + pykerberos + ]; + + checkInputs = [ + mock + pytestCheckHook + ]; # they have a setup.py which mentions a test suite that doesn't exist... patches = [ ./fix_setup.patch ]; + pythonImportsCheck = [ "requests_kerberos" ]; + meta = with lib; { - description = "An authentication handler for using Kerberos with Python Requests."; - homepage = "https://github.com/requests/requests-kerberos"; - license = licenses.isc; + description = "An authentication handler for using Kerberos with Python Requests"; + homepage = "https://github.com/requests/requests-kerberos"; + license = licenses.isc; maintainers = with maintainers; [ catern ]; }; } From 1a4f4b884999f60d1f2518b7a3ea968285ada140 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 2 Apr 2021 12:25:31 +0200 Subject: [PATCH 7/8] python3Packages.aws-adfs: fix build --- .../python-modules/aws-adfs/default.nix | 41 +++++++++++++++---- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/aws-adfs/default.nix b/pkgs/development/python-modules/aws-adfs/default.nix index efe4780c0a4f..2f9cd1a0b19c 100644 --- a/pkgs/development/python-modules/aws-adfs/default.nix +++ b/pkgs/development/python-modules/aws-adfs/default.nix @@ -1,6 +1,19 @@ -{ lib, buildPythonPackage, fetchPypi -, pytest, pytestrunner, pytestcov, mock, glibcLocales, lxml, botocore -, requests, requests-kerberos, click, configparser, fido2, isPy27 }: +{ lib +, botocore +, buildPythonPackage +, click +, configparser +, fetchPypi +, fido2 +, glibcLocales +, isPy27 +, lxml +, mock +, pyopenssl +, pytestCheckHook +, requests +, requests-kerberos +}: buildPythonPackage rec { pname = "aws-adfs"; @@ -12,8 +25,25 @@ buildPythonPackage rec { sha256 = "6a78bd31477ea9988166215ae86abcbfe1413bee20373ecdf0dd170b7290db55"; }; + propagatedBuildInputs = [ + botocore + click + configparser + fido2 + lxml + pyopenssl + requests + requests-kerberos + ]; + + checkInputs = [ + glibcLocales + mock + pytestCheckHook + ]; + # Relax version constraint - patchPhase = '' + postPatch = '' sed -i 's/coverage < 4/coverage/' setup.py ''; @@ -23,9 +53,6 @@ buildPythonPackage rec { # Required for python3 tests, along with glibcLocales LC_ALL = "en_US.UTF-8"; - checkInputs = [ glibcLocales pytest pytestrunner pytestcov mock ]; - propagatedBuildInputs = [ botocore lxml requests requests-kerberos click configparser fido2 ]; - pythonImportsCheck = [ "aws_adfs" ]; meta = with lib; { From 5f5ab8004e58a6deea34c3466cc8a383d47751ed Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 2 Apr 2021 12:29:10 +0200 Subject: [PATCH 8/8] python3Packages.gradient: fix build --- .../python-modules/gradient/default.nix | 54 ++++++++++++++----- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/gradient/default.nix b/pkgs/development/python-modules/gradient/default.nix index c74501c621e7..1965e0d3aded 100644 --- a/pkgs/development/python-modules/gradient/default.nix +++ b/pkgs/development/python-modules/gradient/default.nix @@ -1,8 +1,23 @@ -{ lib, fetchPypi, buildPythonPackage -, attrs, boto3, requests, gradient_statsd, terminaltables -, click-completion , click-didyoumean, click-help-colors -, colorama, requests_toolbelt, gradient-utils, halo, progressbar2 -, marshmallow, pyyaml, websocket_client +{ lib +, attrs +, boto3 +, buildPythonPackage +, click-completion +, click-didyoumean +, click-help-colors +, colorama +, fetchPypi +, gradient_statsd +, gradient-utils +, halo +, marshmallow +, progressbar2 +, pyopenssl +, pyyaml +, requests +, requests_toolbelt +, terminaltables +, websocket_client }: buildPythonPackage rec { @@ -21,11 +36,26 @@ buildPythonPackage rec { --replace 'PyYAML==' 'PyYAML>=' \ --replace 'marshmallow<' 'marshmallow>=' \ --replace 'websocket-client==' 'websocket-client>=' - ''; + ''; - propagatedBuildInputs = [ attrs boto3 requests gradient_statsd terminaltables - click-completion click-didyoumean click-help-colors requests_toolbelt - colorama gradient-utils halo marshmallow progressbar2 pyyaml websocket_client + propagatedBuildInputs = [ + attrs + boto3 + click-completion + click-didyoumean + click-help-colors + colorama + gradient_statsd + gradient-utils + halo + marshmallow + progressbar2 + pyopenssl + pyyaml + requests + requests_toolbelt + terminaltables + websocket_client ]; # tries to use /homeless-shelter to mimic container usage, etc @@ -33,9 +63,9 @@ buildPythonPackage rec { meta = with lib; { description = "The command line interface for Gradient"; - homepage = "https://github.com/Paperspace/gradient-cli"; - license = licenses.isc; - platforms = platforms.unix; + homepage = "https://github.com/Paperspace/gradient-cli"; + license = licenses.isc; + platforms = platforms.unix; maintainers = with maintainers; [ thoughtpolice ]; }; }