From 921f8cf974d558efcd3a1a38c85a49c664016dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 23 Feb 2024 13:12:22 -0800 Subject: [PATCH 01/19] python311Packages.pytest-asyncio_0_21: init at 0.21.1 Version 0.23 was accidentally a breaking change: https://github.com/pytest-dev/pytest-asyncio/issues/706 --- pkgs/top-level/python-packages.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 16e7f5195025..fa1efffa1f35 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11600,6 +11600,16 @@ self: super: with self; { pytest-asyncio = callPackage ../development/python-modules/pytest-asyncio { }; + pytest-asyncio_0_21 = pytest-asyncio.overridePythonAttrs (old: rec { + version = "0.21.1"; + src = pkgs.fetchFromGitHub { + owner = "pytest-dev"; + repo = "pytest-asyncio"; + rev = "refs/tags/v${version}"; + hash = "sha256-Wpo8MpCPGiXrckT2x5/yBYtGlzso/L2urG7yGc7SPkA="; + }; + }); + pytest-bdd = callPackage ../development/python-modules/pytest-bdd { }; pytest-benchmark = callPackage ../development/python-modules/pytest-benchmark { }; From 01cbced4ef81053ad7dfada33f35527511aad724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 23 Feb 2024 13:14:19 -0800 Subject: [PATCH 02/19] python311Packages.autobahn: use pytest-asyncio_0_21 With version 0.23 the tests fail with RuntimeError: Event loop is closed --- pkgs/development/python-modules/autobahn/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/autobahn/default.nix b/pkgs/development/python-modules/autobahn/default.nix index 429082e442b8..2bfbc16e8f91 100644 --- a/pkgs/development/python-modules/autobahn/default.nix +++ b/pkgs/development/python-modules/autobahn/default.nix @@ -27,7 +27,7 @@ , pygobject3 , pyopenssl , qrcode -, pytest-asyncio +, pytest-asyncio_0_21 , python-snappy , pytestCheckHook , pythonOlder @@ -72,7 +72,7 @@ buildPythonPackage rec { nativeCheckInputs = [ mock - pytest-asyncio + pytest-asyncio_0_21 pytestCheckHook ] ++ passthru.optional-dependencies.scram ++ passthru.optional-dependencies.serialization From edb51635cc7facd3da2794284f087fae6cde6732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 23 Feb 2024 15:19:01 -0800 Subject: [PATCH 03/19] python312Packages.spake2: fix build --- .../python-modules/spake2/default.nix | 38 +++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/spake2/default.nix b/pkgs/development/python-modules/spake2/default.nix index 87d05612e712..2ccd62fcdf15 100644 --- a/pkgs/development/python-modules/spake2/default.nix +++ b/pkgs/development/python-modules/spake2/default.nix @@ -1,26 +1,50 @@ -{ lib, buildPythonPackage, fetchPypi, hkdf, pytest }: +{ lib +, buildPythonPackage +, fetchPypi +, fetchpatch2 +, setuptools +, hkdf +, pytestCheckHook +}: buildPythonPackage rec { pname = "spake2"; version = "0.8"; - format = "setuptools"; + pyproject = true; src = fetchPypi { inherit pname version; sha256 = "c17a614b29ee4126206e22181f70a406c618d3c6c62ca6d6779bce95e9c926f4"; }; - nativeCheckInputs = [ pytest ]; + patches = [ + # https://github.com/warner/python-spake2/pull/16 + (fetchpatch2 { + name = "python312-compat.patch"; + url = "https://github.com/warner/python-spake2/commit/1b04d33106b105207c97c64b2589c45790720b0b.patch"; + hash = "sha256-OoBz0lN17VyVGg6UfT+Zj9M1faFTNpPIhxrwCgUwMc8="; + }) + ]; - propagatedBuildInputs = [ hkdf ]; + nativeBuildInputs = [ + setuptools + ]; - checkPhase = '' - py.test $out - ''; + propagatedBuildInputs = [ + hkdf + ]; + + pythonImportsCheck = [ "spake2" ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; meta = with lib; { + changelog = "https://github.com/warner/python-spake2/blob/v${version}/NEWS"; description = "SPAKE2 password-authenticated key exchange library"; homepage = "https://github.com/warner/python-spake2"; license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; }; } From cb8c1e4120b5552391805135044c0a3faf3f8682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 23 Feb 2024 15:19:45 -0800 Subject: [PATCH 04/19] python311Packages.py-ecc: 6.0.0 -> 7.0.0 Diff: https://github.com/ethereum/py_ecc/compare/v6.0.0...v7.0.0 Changelog: https://github.com/ethereum/py_ecc/blob/v7.0.0/CHANGELOG.rst --- .../python-modules/py-ecc/default.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/py-ecc/default.nix b/pkgs/development/python-modules/py-ecc/default.nix index 7845bfe17501..6e2683104775 100644 --- a/pkgs/development/python-modules/py-ecc/default.nix +++ b/pkgs/development/python-modules/py-ecc/default.nix @@ -4,29 +4,32 @@ , cached-property , eth-typing , eth-utils -, mypy-extensions , pytestCheckHook , pythonOlder +, setuptools }: buildPythonPackage rec { pname = "py-ecc"; - version = "6.0.0"; - format = "setuptools"; - disabled = pythonOlder "3.6"; + version = "7.0.0"; + pyproject = true; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "ethereum"; repo = "py_ecc"; rev = "v${version}"; - hash = "sha256-638otYA3e/Ld4mcM69yrqHQnGoK/Sfl/UA9FWnjgO/U="; + hash = "sha256-DKe+bI1GEzXg4Y4n5OA1/hWYz9L3X1AvaOFPEnCaAfs="; }; + nativeBuildInputs = [ + setuptools + ]; + propagatedBuildInputs = [ cached-property eth-typing eth-utils - mypy-extensions ]; nativeCheckInputs = [ @@ -36,6 +39,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "py_ecc" ]; meta = with lib; { + changelog = "https://github.com/ethereum/py_ecc/blob/${src.rev}/CHANGELOG.rst"; description = "ECC pairing and bn_128 and bls12_381 curve operations"; homepage = "https://github.com/ethereum/py_ecc"; license = licenses.mit; From f784710a1a0c7363f79aa0fd048245af8c8a081f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 23 Feb 2024 15:31:42 -0800 Subject: [PATCH 05/19] python312Packages.eth-utils: 2.1.1 -> 4.0.0 Diff: https://github.com/ethereum/eth-utils/compare/v2.1.1...v4.0.0 Changelog: https://github.com/ethereum/eth-utils/blob/v4.0.0/docs/release_notes.rst --- .../python-modules/eth-utils/default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/eth-utils/default.nix b/pkgs/development/python-modules/eth-utils/default.nix index 6d4cbf930f56..8686da98d92a 100644 --- a/pkgs/development/python-modules/eth-utils/default.nix +++ b/pkgs/development/python-modules/eth-utils/default.nix @@ -8,22 +8,27 @@ , isPyPy , pytestCheckHook , pythonOlder +, setuptools , toolz }: buildPythonPackage rec { pname = "eth-utils"; - version = "2.1.1"; - format = "setuptools"; + version = "4.0.0"; + pyproject = true; disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "ethereum"; - repo = pname; + repo = "eth-utils"; rev = "v${version}"; - hash = "sha256-Ogp4o99smw5qVwDec6zd/xVqqKMyNk41iBfRNzrwuvE="; + hash = "sha256-k2pHM1eKPzoGxZlU6yT7bZMv4CCWGaZaSnFHSbT76Zo="; }; + nativeBuildInputs = [ + setuptools + ]; + propagatedBuildInputs = [ eth-hash eth-typing @@ -44,6 +49,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "eth_utils" ]; meta = { + changelog = "https://github.com/ethereum/eth-utils/blob/${src.rev}/docs/release_notes.rst"; description = "Common utility functions for codebases which interact with ethereum"; homepage = "https://github.com/ethereum/eth-utils"; license = lib.licenses.mit; From 7d0ac96293b167e0f039bb93f1075d99679134de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 23 Feb 2024 15:33:56 -0800 Subject: [PATCH 06/19] python312Packages.eth-typing: 3.2.0 -> 4.0.0 Diff: https://github.com/ethereum/eth-typing/compare/refs/tags/v3.2.0...v4.0.0 Changelog: https://github.com/ethereum/eth-typing/blob/v4.0.0/docs/release_notes.rst --- .../development/python-modules/eth-typing/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/eth-typing/default.nix b/pkgs/development/python-modules/eth-typing/default.nix index 434fc6d8c10d..60bafffaea2a 100644 --- a/pkgs/development/python-modules/eth-typing/default.nix +++ b/pkgs/development/python-modules/eth-typing/default.nix @@ -3,12 +3,13 @@ , buildPythonPackage , pythonOlder , pytestCheckHook +, setuptools }: buildPythonPackage rec { pname = "eth-typing"; - version = "3.2.0"; - format = "setuptools"; + version = "4.0.0"; + pyproject = true; disabled = pythonOlder "3.6"; @@ -16,9 +17,13 @@ buildPythonPackage rec { owner = "ethereum"; repo = "eth-typing"; rev = "refs/tags/v${version}"; - hash = "sha256-klN38pIQ9ZOFV7dzXNvylPGfifR8pXRLTJ3VE579AY0="; + hash = "sha256-JT/2bCPYFSRNt3V7QnHSAJR7HrZ1JpRKdU7gQpoYIn0="; }; + nativeBuildInputs = [ + setuptools + ]; + nativeCheckInputs = [ pytestCheckHook ]; From c6d343cabd2a61d6a64b2f31ebf9306976c9e72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 23 Feb 2024 15:44:38 -0800 Subject: [PATCH 07/19] python312Packages.py-ecc: disable failing tests --- pkgs/development/python-modules/py-ecc/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/python-modules/py-ecc/default.nix b/pkgs/development/python-modules/py-ecc/default.nix index 6e2683104775..d7769ea4873d 100644 --- a/pkgs/development/python-modules/py-ecc/default.nix +++ b/pkgs/development/python-modules/py-ecc/default.nix @@ -5,6 +5,7 @@ , eth-typing , eth-utils , pytestCheckHook +, pythonAtLeast , pythonOlder , setuptools }: @@ -36,6 +37,18 @@ buildPythonPackage rec { pytestCheckHook ]; + disabledTests = lib.optionals (pythonAtLeast "3.12") [ + # https://github.com/ethereum/py_ecc/issues/133 + "test_FQ2_object" + "test_pairing_bilinearity_on_G1" + "test_pairing_bilinearity_on_G2" + "test_pairing_composit_check" + "test_pairing_is_non_degenerate" + "test_pairing_negative_G1" + "test_pairing_negative_G2" + "test_pairing_output_order" + ]; + pythonImportsCheck = [ "py_ecc" ]; meta = with lib; { From ca63a1b87be6fd837af3ec20c56c2fcf3659a437 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 23 Feb 2024 23:32:27 +0100 Subject: [PATCH 08/19] python311Packages.pytest-benchmark: fix tests - Backports two patches to fix tests from Python 3.11 - Updates the disabled test sets for failures that only happen for <3.12 - Ignores DeprecationWarnings during the test run - Converted to use the PEP517 builder --- .../pytest-benchmark/default.nix | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/pytest-benchmark/default.nix b/pkgs/development/python-modules/pytest-benchmark/default.nix index f9011b6d721b..dc2c27137169 100644 --- a/pkgs/development/python-modules/pytest-benchmark/default.nix +++ b/pkgs/development/python-modules/pytest-benchmark/default.nix @@ -14,16 +14,16 @@ , pytestCheckHook , pytest-xdist , pythonOlder -, isPy311 +, setuptools }: buildPythonPackage rec { pname = "pytest-benchmark"; version = "4.0.0"; + pyproject = true; disabled = pythonOlder "3.7"; - format = "setuptools"; src = fetchFromGitHub { owner = "ionelmc"; @@ -33,10 +33,24 @@ buildPythonPackage rec { }; patches = [ + # replace distutils.spawn.find_executable with shutil.which (fetchpatch { url = "https://github.com/ionelmc/pytest-benchmark/commit/728752d2976ef53fde7e40beb3e55f09cf4d4736.patch"; hash = "sha256-WIQADCLey5Y79UJUj9J5E02HQ0O86xBh/3IeGLpVrWI="; }) + # fix tests with python3.11+; https://github.com/ionelmc/pytest-benchmark/pull/232 + (fetchpatch { + url = "https://github.com/ionelmc/pytest-benchmark/commit/b2f624afd68a3090f20187a46284904dd4baa4f6.patch"; + hash = "sha256-cylxPj/d0YzvOGw+ncVSCnQHwq2cukrgXhBHePPwjO0="; + }) + (fetchpatch { + url = "https://github.com/ionelmc/pytest-benchmark/commit/2b987f5be1873617f02f24cb6d76196f9aed21bd.patch"; + hash = "sha256-92kWEd935Co6uc/1y5OGKsc5/or81bORSdaiQFjDyTw="; + }) + ]; + + nativeBuildInputs = [ + setuptools ]; buildInputs = [ @@ -64,24 +78,23 @@ buildPythonPackage rec { mercurial pytestCheckHook pytest-xdist - ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); + ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies); + + pytestFlagsArray = [ + "-W" "ignore::DeprecationWarning" + ]; preCheck = '' export PATH="$out/bin:$PATH" ''; - disabledTests = [ + disabledTests = lib.optionals (pythonOlder "3.12") [ # AttributeError: 'PluginImportFixer' object has no attribute 'find_spec' "test_compare_1" "test_compare_2" "test_regression_checks" + "test_regression_checks_inf" "test_rendering" - ] - # tests are broken in 3.11 - # https://github.com/ionelmc/pytest-benchmark/issues/231 - ++ lib.optionals isPy311 [ - "test_abort_broken" - "test_clonefunc" ]; meta = with lib; { From d5c1111cf2d5354d5bf09c72ec508b3f2fec8031 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 18 Feb 2024 13:41:46 +0100 Subject: [PATCH 09/19] python312Packages.partd: fix build, refactor Partd ships with a broken vendored versioneer file, that calls into things that are not available on 3.12 anymore. Update dependencies, use the pytest hook instead of overriding the checkPhase. --- .../python-modules/partd/default.nix | 57 ++++++++++++++----- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/partd/default.nix b/pkgs/development/python-modules/partd/default.nix index 728ed09b735c..b5f8afce9d3b 100644 --- a/pkgs/development/python-modules/partd/default.nix +++ b/pkgs/development/python-modules/partd/default.nix @@ -1,14 +1,24 @@ { lib , buildPythonPackage -, fetchPypi -, isPy27 +, fetchFromGitHub +, fetchpatch2 +, pythonOlder + +# build-system , setuptools -, pytest + +# dependencies , locket +, toolz + +# optional-dependencies +, blosc2 , numpy , pandas , pyzmq -, toolz + +# tests +, pytestCheckHook }: buildPythonPackage rec { @@ -16,25 +26,44 @@ buildPythonPackage rec { version = "1.4.1"; pyproject = true; - disabled = isPy27; + disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit pname version; - hash = "sha256-VsJd1J5v6lcn5zEgPEZsbgkvMI2PACThmdAvaqIWf2c="; + src = fetchFromGitHub { + owner = "dask"; + repo = "partd"; + rev = "refs/tags/${version}"; + hash = "sha256-EK+HNSPh2b7jwpc6jwH/n+6HDgHhRfBeaRuiDIWVG28="; }; + patches = [ + (fetchpatch2 { + # python 3.12 support; https://github.com/dask/partd/pull/70 + url = "https://github.com/dask/partd/pull/70/commits/c96a034367cb9fee0a0900f758b802aeef8a8a41.patch"; + hash = "sha256-QlSIrFQQQo9We/gf7WSgmWrxdt3rxXQcyvJnFm8R5cM="; + }) + ]; + nativeBuildInputs = [ setuptools ]; - nativeCheckInputs = [ pytest ]; + propagatedBuildInputs = [ + locket + toolz + ]; - propagatedBuildInputs = [ locket numpy pandas pyzmq toolz ]; + passthru.optional-dependencies = { + complete = [ + blosc2 + numpy + pandas + pyzmq + ]; + }; - checkPhase = '' - rm partd/tests/test_zmq.py # requires network & fails - py.test -k "not test_serialize" - ''; + nativeCheckInputs = [ + pytestCheckHook + ]; meta = { description = "Appendable key-value storage"; From 8adc7b7875923d27c255e8fbef66b423caf8a0a7 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 24 Feb 2024 01:32:52 +0100 Subject: [PATCH 10/19] python312Packages.black: ignore DeprecationWarning during tests --- pkgs/development/python-modules/black/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/black/default.nix b/pkgs/development/python-modules/black/default.nix index 52cc36e989cc..73ce7f8d30fd 100644 --- a/pkgs/development/python-modules/black/default.nix +++ b/pkgs/development/python-modules/black/default.nix @@ -5,7 +5,6 @@ , pythonOlder , pytestCheckHook , aiohttp -, aiohttp-cors , click , colorama , hatch-fancy-pypi-readme @@ -19,7 +18,6 @@ , platformdirs , tokenize-rt , tomli -, typed-ast , typing-extensions , uvloop }: @@ -78,6 +76,10 @@ buildPythonPackage rec { parameterized ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies); + pytestFlagsArray = [ + "-W" "ignore::DeprecationWarning" + ]; + preCheck = '' export PATH="$PATH:$out/bin" From 97dcead2631cc3a0f1232cef69b1a715d2e7a180 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 24 Feb 2024 01:54:26 +0100 Subject: [PATCH 11/19] python311Packages.param: ignore DeprecationWarning on tests --- pkgs/development/python-modules/param/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/param/default.nix b/pkgs/development/python-modules/param/default.nix index f6bbbf3b78ff..638a3182ca1b 100644 --- a/pkgs/development/python-modules/param/default.nix +++ b/pkgs/development/python-modules/param/default.nix @@ -40,6 +40,10 @@ buildPythonPackage rec { pytestCheckHook ]; + pytestFlagsArray = [ + "-W" "ignore::DeprecationWarning" + ]; + pythonImportsCheck = [ "param" ]; From 820b56f17d5d9ce8e5ba0660525ac844e82fe167 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 24 Feb 2024 02:14:09 +0100 Subject: [PATCH 12/19] python312Packages.mypy: skip failing test --- pkgs/development/python-modules/mypy/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/python-modules/mypy/default.nix b/pkgs/development/python-modules/mypy/default.nix index 0087fa650d7a..ba8b5a276197 100644 --- a/pkgs/development/python-modules/mypy/default.nix +++ b/pkgs/development/python-modules/mypy/default.nix @@ -2,6 +2,7 @@ , stdenv , buildPythonPackage , fetchFromGitHub +, pythonAtLeast , pythonOlder # build-system @@ -100,6 +101,11 @@ buildPythonPackage rec { tomli ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies); + disabledTests = lib.optionals (pythonAtLeast "3.12") [ + # requires distutils + "test_c_unit_test" + ]; + disabledTestPaths = [ # fails to find tyoing_extensions "mypy/test/testcmdline.py" From c13dadf60c321a4768da5f01f0327250679f9940 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 24 Feb 2024 02:22:37 +0100 Subject: [PATCH 13/19] python311Packages.beartype: 0.16.4 -> 0.17.2 https://github.com/beartype/beartype/releases/tag/v0.17.2 --- pkgs/development/python-modules/beartype/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/beartype/default.nix b/pkgs/development/python-modules/beartype/default.nix index 3eba6f3317a4..b5091bf519d0 100644 --- a/pkgs/development/python-modules/beartype/default.nix +++ b/pkgs/development/python-modules/beartype/default.nix @@ -1,6 +1,7 @@ { lib , buildPythonPackage , fetchPypi +, setuptools , pytestCheckHook , pythonOlder , typing-extensions @@ -8,16 +9,20 @@ buildPythonPackage rec { pname = "beartype"; - version = "0.16.4"; + version = "0.17.2"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-GtqJzy1usw624Vbu0utUkzV3gpN5ENdDgJGOU8Lq4L8="; + hash = "sha256-6RHhrn3kvM0VdF92Q2CdhzL2TeXC+4ROicu+0cWo1JU="; }; + nativeBuildInputs = [ + setuptools + ]; + nativeCheckInputs = [ pytestCheckHook typing-extensions From 61e612ad380df17481606dc1b7eeaa8038f914ca Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 24 Feb 2024 02:46:44 +0100 Subject: [PATCH 14/19] python311Packages.asyncua: pin to pytest-asyncio 0.21 --- pkgs/development/python-modules/asyncua/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/asyncua/default.nix b/pkgs/development/python-modules/asyncua/default.nix index 774569543628..e2417b6a2463 100644 --- a/pkgs/development/python-modules/asyncua/default.nix +++ b/pkgs/development/python-modules/asyncua/default.nix @@ -6,7 +6,7 @@ , cryptography , fetchFromGitHub , pyopenssl -, pytest-asyncio +, pytest-asyncio_0_21 , pytest-mock , pytestCheckHook , python-dateutil @@ -60,7 +60,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - pytest-asyncio + pytest-asyncio_0_21 pytest-mock ]; From b055c2641043c5028db00543713813d7079e882b Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 24 Feb 2024 02:47:06 +0100 Subject: [PATCH 15/19] python311Packages.openai: ignore DeprecationWarning during tests --- pkgs/development/python-modules/openai/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/openai/default.nix b/pkgs/development/python-modules/openai/default.nix index dab58b533265..78ace71a3575 100644 --- a/pkgs/development/python-modules/openai/default.nix +++ b/pkgs/development/python-modules/openai/default.nix @@ -74,6 +74,10 @@ buildPythonPackage rec { dirty-equals ]; + pytestFlagsArray = [ + "-W" "ignore::DeprecationWarning" + ]; + disabledTests = [ # Tests make network requests "test_streaming_response" From 59ad9d607dcb5b1bc2fcd5b13385033cb49bee51 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 24 Feb 2024 02:52:51 +0100 Subject: [PATCH 16/19] python311Packages.sip: 6.8.1 -> 6.8.3 https://github.com/Python-SIP/sip/releases/tag/6.8.2 https://github.com/Python-SIP/sip/releases/tag/6.8.3 --- pkgs/development/python-modules/sip/default.nix | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/sip/default.nix b/pkgs/development/python-modules/sip/default.nix index 32c28211cd06..30dd904f1396 100644 --- a/pkgs/development/python-modules/sip/default.nix +++ b/pkgs/development/python-modules/sip/default.nix @@ -1,10 +1,8 @@ { lib -, stdenv , buildPythonPackage , fetchPypi , pythonOlder , setuptools -, wheel , packaging , ply , toml @@ -18,21 +16,22 @@ buildPythonPackage rec { pname = "sip"; - version = "6.8.1"; - - format = "pyproject"; + version = "6.8.3"; + pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-MALfQV4WisP/45OULbxxMcuCreUAAOFSb0aoit4m9Zg="; + hash = "sha256-iIVHsBi7JMNq3tUZ6T0+UT1MaqC6VbfMGv+9Rc8Qdiw="; }; nativeBuildInputs = [ setuptools - wheel ]; - propagatedBuildInputs = [ packaging ply toml ] ++ lib.optionals (pythonOlder "3.11") [ + propagatedBuildInputs = [ + packaging + setuptools + ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; From 544c197eb80505155ceea67aac87af9f217f7310 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 24 Feb 2024 02:59:21 +0100 Subject: [PATCH 17/19] python312Packages.sip4: disable --- pkgs/development/python-modules/sip/4.x.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/sip/4.x.nix b/pkgs/development/python-modules/sip/4.x.nix index 0e1db82e8af0..879dc6cd125a 100644 --- a/pkgs/development/python-modules/sip/4.x.nix +++ b/pkgs/development/python-modules/sip/4.x.nix @@ -5,7 +5,8 @@ buildPythonPackage rec { version = "4.19.25"; format = "other"; - disabled = isPyPy; + # relies on distutils + disabled = isPyPy || pythonAtLeast "3.12"; src = fetchurl { url = "https://www.riverbankcomputing.com/static/Downloads/sip/${version}/sip-${version}.tar.gz"; From bc38c1274e359e6c4bec15c58cc85cecf2d81940 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 24 Feb 2024 03:09:47 +0100 Subject: [PATCH 18/19] python312Packages.sanic: disable failing test --- pkgs/development/python-modules/sanic/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/sanic/default.nix b/pkgs/development/python-modules/sanic/default.nix index 752802df209c..fb1d5aba58db 100644 --- a/pkgs/development/python-modules/sanic/default.nix +++ b/pkgs/development/python-modules/sanic/default.nix @@ -3,6 +3,7 @@ , buildPythonPackage , fetchFromGitHub , fetchpatch +, pythonAtLeast # build-system , setuptools @@ -145,6 +146,9 @@ buildPythonPackage rec { "test_websocket_route_with_subprotocols" # Socket closes early "test_no_exceptions_when_cancel_pending_request" + ] ++ lib.optionals (pythonAtLeast "3.12") [ + # AttributeError: 'has_calls' is not a valid assertion. Use a spec for the mock if 'has_calls' is meant to be an attribute. + "test_ws_frame_put_message_into_queue" ]; disabledTestPaths = [ From 876379f8831012a0fec768898f0d3ef68df16bf5 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 24 Feb 2024 03:16:02 +0100 Subject: [PATCH 19/19] python312Packages.smartypants: fix tests and regex patterns --- .../python-modules/smartypants/default.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/smartypants/default.nix b/pkgs/development/python-modules/smartypants/default.nix index 0e5ef76927e4..d2ca5f297322 100644 --- a/pkgs/development/python-modules/smartypants/default.nix +++ b/pkgs/development/python-modules/smartypants/default.nix @@ -1,7 +1,9 @@ { lib , buildPythonPackage , fetchFromGitHub +, fetchpatch2 , isPyPy +, setuptools , docutils , pygments , pytestCheckHook @@ -9,8 +11,9 @@ buildPythonPackage rec { version = "2.0.1"; - format = "setuptools"; pname = "smartypants"; + pyproject = true; + disabled = isPyPy; src = fetchFromGitHub { @@ -20,6 +23,19 @@ buildPythonPackage rec { sha256 = "00p1gnb9pzb3svdq3c5b9b332gsp50wrqqa39gj00m133zadanjp"; }; + patches = [ + (fetchpatch2 { + # https://github.com/leohemsted/smartypants.py/pull/21 + name = "smartypants-3.12-compat.patch"; + url = "https://github.com/leohemsted/smartypants.py/commit/ea46bf36343044a7a61ba3acce4a7f188d986ec5.patch"; + hash = "sha256-9lsiiZKFFKHLy7j3y9ff4gt01szY+2AHpWPAKQgKwZg="; + }) + ]; + + nativeBuildInputs = [ + setuptools + ]; + nativeCheckInputs = [ docutils pygments