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 1/7] 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 2/7] 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 3/7] 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 4/7] 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 5/7] 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 6/7] 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 7/7] 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; {