From 570f8ba9f1dd47a60439b82c925d4e39addb32bb Mon Sep 17 00:00:00 2001 From: Florian Franzen Date: Tue, 17 Sep 2024 23:44:25 +0200 Subject: [PATCH] python312Packages.web3: 6.5.0 -> 7.2.0 --- .../python-modules/web3/default.nix | 55 +++++++++++++++---- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/web3/default.nix b/pkgs/development/python-modules/web3/default.nix index 08fc850f9e507c..9f0a6e71d64a96 100644 --- a/pkgs/development/python-modules/web3/default.nix +++ b/pkgs/development/python-modules/web3/default.nix @@ -7,29 +7,38 @@ eth-abi, eth-account, eth-hash, + eth-tester, eth-typing, eth-utils, + flaky, hexbytes, + hypothesis, ipfshttpclient, jsonschema, lru-dict, protobuf, + pydantic, + pytestCheckHook, + pytest-asyncio_0_21, + pytest-mock, + pytest-xdist, + pyunormalize, + py-evm, requests, + setuptools, + types-requests, websockets, }: buildPythonPackage rec { pname = "web3"; - version = "6.5.0"; - format = "setuptools"; - - disabled = pythonOlder "3.7"; + version = "7.6.1"; src = fetchFromGitHub { owner = "ethereum"; repo = "web3.py"; rev = "v${version}"; - hash = "sha256-RNWCZQjcse415SSNkHhMWckDcBJGFZnjisckF7gbYY8="; + hash = "sha256-rpXSkQtqUZiCLMF2XlElbsjFjJmX+3j/NdAU2oaPU54="; }; # Note: to reflect the extra_requires in main/setup.py. @@ -37,7 +46,9 @@ buildPythonPackage rec { ipfs = [ ipfshttpclient ]; }; - propagatedBuildInputs = + build-system = [ setuptools ]; + + dependencies = [ aiohttp eth-abi @@ -52,16 +63,38 @@ buildPythonPackage rec { jsonschema lru-dict protobuf + pydantic requests + types-requests websockets ]; - # TODO: package eth-tester required for tests - doCheck = false; + nativeCheckInputs = [ + pytestCheckHook + eth-tester + flaky + hypothesis + pytest-asyncio_0_21 + pytest-mock + pytest-xdist + pyunormalize + py-evm + ]; + + disabledTests = [ + # side-effect: runs pip online check and is blocked by sandbox + "test_install_local_wheel" + # not sure why they fail + "test_init_multiple_contracts_performance" + "test_async_init_multiple_contracts_performance" + ]; - postPatch = '' - substituteInPlace setup.py --replace "types-protobuf==3.19.13" "types-protobuf" - ''; + disabledTestPaths = [ + # requires geth library and binaries + "tests/integration/go_ethereum" + # requires local running beacon node + "tests/beacon" + ]; pythonImportsCheck = [ "web3" ];