From fe9c8fed9ea1bc594b566bdeebd440807792926b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 12 Oct 2023 10:38:57 +0200 Subject: [PATCH 1/7] python311Packages.tldextract: 3.6.0 -> 5.0.0 Changelog: https://github.com/john-kurkowski/tldextract/releases/tag/5.0.0 --- .../python-modules/tldextract/default.nix | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/tldextract/default.nix b/pkgs/development/python-modules/tldextract/default.nix index 04a6762c8c90..c8052da27894 100644 --- a/pkgs/development/python-modules/tldextract/default.nix +++ b/pkgs/development/python-modules/tldextract/default.nix @@ -1,6 +1,6 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub , filelock , idna , pytest-mock @@ -14,17 +14,21 @@ }: buildPythonPackage rec { - pname = "tldextract"; - version = "3.6.0"; - format = "pyproject"; + pname = "tldextract"; + version = "5.0.0"; + pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.8"; - src = fetchPypi { - inherit pname version; - hash = "sha256-pdi2WDeR2sominWS6892QVL6SWF5g8SZFu6d6Zs2YiI="; + src = fetchFromGitHub { + owner = "john-kurkowski"; + repo = "tldextract"; + rev = "refs/tags/${version}"; + hash = "sha256-oZ7L7DGe9HmBo5a489LXjajiSecJNLGHzCF/7DV9au4="; }; + SETUPTOOLS_SCM_PRETEND_VERSION = version; + nativeBuildInputs = [ setuptools setuptools-scm @@ -43,11 +47,6 @@ buildPythonPackage rec { responses ]; - postPatch = '' - substituteInPlace pytest.ini \ - --replace " --pylint" "" - ''; - pythonImportsCheck = [ "tldextract" ]; @@ -59,6 +58,7 @@ buildPythonPackage rec { from the registered domain and subdomains of a URL. ''; homepage = "https://github.com/john-kurkowski/tldextract"; + changelog = "https://github.com/john-kurkowski/tldextract/blob/${version}/CHANGELOG.md"; license = with licenses; [ bsd3 ]; maintainers = with maintainers; [ fab ]; }; From ad2ab5bd6098f0b2aaf2b487aa1010d4bd794f88 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 17 Oct 2023 10:28:50 +0200 Subject: [PATCH 2/7] python311Packages.certauth: disable tests which requires network access --- .../python-modules/certauth/default.nix | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/certauth/default.nix b/pkgs/development/python-modules/certauth/default.nix index b789fe5d16f8..04a4637bafc9 100644 --- a/pkgs/development/python-modules/certauth/default.nix +++ b/pkgs/development/python-modules/certauth/default.nix @@ -4,20 +4,29 @@ , pyopenssl , tldextract , pytestCheckHook -, pytest-cov +, pythonOlder }: buildPythonPackage rec { pname = "certauth"; version = "1.3.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "ikreymer"; repo = "certauth"; - rev = "ad2bae5d40a9e45519fc1f2cd7678174bbc55b3d"; # Repo has no git tags + # Repo has no git tags, https://github.com/ikreymer/certauth/issues/15 + rev = "ad2bae5d40a9e45519fc1f2cd7678174bbc55b3d"; hash = "sha256-Rso5N0jb9k7bdorjPIUMNiZZPnzwbkxFNiTpsJ9pco0="; }; + postPatch = '' + substituteInPlace setup.py \ + --replace "--cov certauth " "" + ''; + propagatedBuildInputs = [ pyopenssl tldextract @@ -25,10 +34,20 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - pytest-cov ]; - pythonImportsCheck = [ "certauth" ]; + pythonImportsCheck = [ + "certauth" + ]; + + disabledTests = [ + # Tests want to download Public Suffix List + "test_file_wildcard" + "test_file_wildcard_subdomains" + "test_in_mem_parent_wildcard_cert" + "test_in_mem_parent_wildcard_cert_at_tld" + "test_in_mem_parent_wildcard_cert_2" + ]; meta = with lib; { description = "Simple CertificateAuthority and host certificate creation, useful for man-in-the-middle HTTPS proxy"; From 1e4cde941e11fe6a0447414f692a8815d8d3adbc Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 17 Oct 2023 10:57:02 +0200 Subject: [PATCH 3/7] python311Packages.dns-lexicon: 3.14.0 -> 3.16.0 Diff: https://github.com/Analogj/lexicon/compare/refs/tags/v3.16.0...v3.16.0 Changelog: https://github.com/AnalogJ/lexicon/blob/v3.16.0/CHANGELOG.md --- .../python-modules/dns-lexicon/default.nix | 112 ++++++++++++------ 1 file changed, 73 insertions(+), 39 deletions(-) diff --git a/pkgs/development/python-modules/dns-lexicon/default.nix b/pkgs/development/python-modules/dns-lexicon/default.nix index bef030ca604d..e8763988fdb9 100644 --- a/pkgs/development/python-modules/dns-lexicon/default.nix +++ b/pkgs/development/python-modules/dns-lexicon/default.nix @@ -1,62 +1,88 @@ -{ buildPythonPackage -, fetchFromGitHub -, poetry-core +{ lib , beautifulsoup4 +, boto3 +, buildPythonPackage , cryptography +, dnspython +, fetchFromGitHub , importlib-metadata +, localzone +, oci +, poetry-core +, pyotp +, pytest-vcr +, pytestCheckHook +, pythonOlder , pyyaml , requests -, tldextract -, pytestCheckHook -, pytest-vcr -# Optional depedencies -, boto3 -, localzone , softlayer +, tldextract , zeep -, dnspython -, oci -, lib }: buildPythonPackage rec { pname = "dns_lexicon"; - version = "3.14.1"; - format = "pyproject"; + version = "3.16.0"; + pyproject = true; + + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "Analogj"; repo = "lexicon"; - rev = "v${version}"; - hash = "sha256-flK2G9mdUWMUACQPo6TqYZ388EacIqkq//tCzUS+Eo8="; + rev = "refs/tags/v${version}"; + hash = "sha256-GUYsTZPvsqGemViSqgEvYhyjTEut42akMq2ZK2P1fX0="; }; - nativeBuildInputs = [ poetry-core ]; + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + beautifulsoup4 + cryptography + pyotp + pyyaml + requests + tldextract + ] ++ lib.optionals (pythonOlder "3.10") [ + importlib-metadata + ]; + + passthru.optional-dependencies = { + route53 = [ + boto3 + ]; + localzone = [ + localzone + ]; + softlayer = [ + softlayer + ]; + ddns = [ + dnspython + ]; + duckdns = [ + dnspython + ]; + oci = [ + oci + ]; + full = [ + boto3 + dnspython + localzone + oci + softlayer + zeep + ]; + }; nativeCheckInputs = [ pytestCheckHook pytest-vcr ] ++ passthru.optional-dependencies.full; - propagatedBuildInputs = [ - beautifulsoup4 - cryptography - importlib-metadata - pyyaml - requests - tldextract - ]; - - passthru.optional-dependencies = { - route53 = [ boto3 ]; - localzone = [ localzone ]; - softlayer = [ softlayer ]; - ddns = [ dnspython ]; - duckdns = [ dnspython ]; - oci = [ oci ]; - full = [ boto3 localzone softlayer zeep dnspython oci ]; - }; - pytestFlagsArray = [ "tests/" ]; @@ -64,11 +90,20 @@ buildPythonPackage rec { disabledTestPaths = [ # Needs network access "tests/providers/test_auto.py" - # Needs network access (and an API token) "tests/providers/test_namecheap.py" ]; + disabledTests = [ + # Tests want to download Public Suffix List + "test_client_legacy_init" + "test_client_basic_init" + "test_client_init" + "test_client_parse_env" + "test_missing" + "action_is_correctly" + ]; + pythonImportsCheck = [ "lexicon" ]; @@ -77,8 +112,7 @@ buildPythonPackage rec { description = "Manipulate DNS records on various DNS providers in a standardized way"; homepage = "https://github.com/AnalogJ/lexicon"; changelog = "https://github.com/AnalogJ/lexicon/blob/v${version}/CHANGELOG.md"; - maintainers = with maintainers; [ aviallon ]; license = with licenses; [ mit ]; + maintainers = with maintainers; [ aviallon ]; }; - } From 514cba75b2f3bc548327da407c21f6b2df840f7f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 17 Oct 2023 11:05:28 +0200 Subject: [PATCH 4/7] python311Packages.corsair-scan: disable tests which require network access --- .../python-modules/corsair-scan/default.nix | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/corsair-scan/default.nix b/pkgs/development/python-modules/corsair-scan/default.nix index ecebf7f92c1b..82ef32b2d7b3 100644 --- a/pkgs/development/python-modules/corsair-scan/default.nix +++ b/pkgs/development/python-modules/corsair-scan/default.nix @@ -14,15 +14,22 @@ buildPythonPackage rec { pname = "corsair-scan"; version = "0.2.0"; + format = "setuptools"; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "Santandersecurityresearch"; repo = "corsair_scan"; - rev = "v${version}"; - sha256 = "09jsv5bag7mjy0rxsxjzmg73rjl7qknzr0d7a7himd7v6a4ikpmk"; + rev = "refs/tags/v${version}"; + hash = "sha256-s94ZiTL7tBrhUaeB/O3Eh8o8zqtfdt0z8LKep1bZWiY="; }; + postPatch = '' + substituteInPlace setup.py \ + --replace "'pytest-runner'," "" + ''; + propagatedBuildInputs = [ validators requests @@ -36,16 +43,20 @@ buildPythonPackage rec { pytestCheckHook ]; - postPatch = '' - substituteInPlace setup.py \ - --replace "'pytest-runner'," "" - ''; + pythonImportsCheck = [ + "corsair_scan" + ]; - pythonImportsCheck = [ "corsair_scan" ]; + disabledTests = [ + # Tests want to download Public Suffix List + "test_corsair_scan_401" + "test_corsair_scan_origin" + ]; meta = with lib; { description = "Python module to check for Cross-Origin Resource Sharing (CORS) misconfigurations"; homepage = "https://github.com/Santandersecurityresearch/corsair_scan"; + changelog = "https://github.com/Santandersecurityresearch/corsair_scan/releases/tag/v${version}"; license = with licenses; [ mit ]; maintainers = with maintainers; [ fab ]; }; From 38d82e90c6b727e1d4a8c25c59d23968a754b0c2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 17 Oct 2023 11:07:38 +0200 Subject: [PATCH 5/7] python311Packages.asyncwhois: disable tests which require network access --- pkgs/development/python-modules/asyncwhois/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/asyncwhois/default.nix b/pkgs/development/python-modules/asyncwhois/default.nix index cddb597b43e0..d05ad0d95893 100644 --- a/pkgs/development/python-modules/asyncwhois/default.nix +++ b/pkgs/development/python-modules/asyncwhois/default.nix @@ -1,6 +1,7 @@ { lib , buildPythonPackage , fetchFromGitHub +, pytest-asyncio , pytest-mock , pytestCheckHook , python-socks @@ -18,7 +19,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "pogzyb"; - repo = pname; + repo = "asyncwhois"; rev = "refs/tags/v${version}"; hash = "sha256-OiDi9hD2IDDfQoQoPhLpClBnJyI/wlZfGyzqmVI94yA="; }; @@ -30,6 +31,7 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ + pytest-asyncio pytest-mock pytestCheckHook ]; @@ -52,6 +54,8 @@ buildPythonPackage rec { "test_whois_query_run" "test_whois_query_create_connection" "test_whois_query_send_and_recv" + "test_input_parameters_for_domain_query" + "test__get_top_level_domain" ]; pythonImportsCheck = [ From aba7912b9e1e499b8d8131e5d7c28b7e18b3c358 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 17 Oct 2023 12:28:18 +0200 Subject: [PATCH 6/7] python311Packages.surt: disable tests which requires network access --- .../python-modules/surt/default.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/surt/default.nix b/pkgs/development/python-modules/surt/default.nix index a13bfb154ff4..d11e8e2fe53f 100644 --- a/pkgs/development/python-modules/surt/default.nix +++ b/pkgs/development/python-modules/surt/default.nix @@ -1,19 +1,24 @@ { lib , buildPythonPackage , fetchFromGitHub +, pytestCheckHook +, pythonOlder , six , tldextract -, pytestCheckHook }: buildPythonPackage rec { pname = "surt"; version = "0.3.1"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "internetarchive"; repo = "surt"; - rev = "6934c321b3e2f66af9c001d882475949f00570c5"; # Has no git tag + # Has no git tag, https://github.com/internetarchive/surt/issues/26 + rev = "6934c321b3e2f66af9c001d882475949f00570c5"; hash = "sha256-pSMNpFfq2V0ANWNFPcb1DwPHccbfddo9P4xZ+ghwbz4="; }; @@ -26,7 +31,15 @@ buildPythonPackage rec { pytestCheckHook ]; - pythonImportsCheck = [ "surt" ]; + pythonImportsCheck = [ + "surt" + ]; + + disabledTests = [ + # Tests want to download Public Suffix List + "test_getPublicPrefix" + "test_getPublicSuffix" + ]; meta = with lib; { description = "Sort-friendly URI Reordering Transform (SURT) python module"; From be5acc54364a2508e557a47383b4568908571f63 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 17 Oct 2023 12:53:39 +0200 Subject: [PATCH 7/7] python311Packages.scrapy: disable tests which require network access --- pkgs/development/python-modules/scrapy/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/scrapy/default.nix b/pkgs/development/python-modules/scrapy/default.nix index 7bfa428efaef..c0ec21bf6afd 100644 --- a/pkgs/development/python-modules/scrapy/default.nix +++ b/pkgs/development/python-modules/scrapy/default.nix @@ -101,6 +101,8 @@ buildPythonPackage rec { "test_persist" "test_timeout_download_from_spider_nodata_rcvd" "test_timeout_download_from_spider_server_hangs" + "test_unbounded_response" + "CookiesMiddlewareTest" # Depends on uvloop "test_asyncio_enabled_reactor_different_loop" "test_asyncio_enabled_reactor_same_loop"