From 088d709926e388006dd9db1c416d911f05e8ac0f 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.6.1 --- .../python-modules/web3/default.nix | 61 +++++++++++++++---- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/web3/default.nix b/pkgs/development/python-modules/web3/default.nix index 08fc850f9e507c..df894986b3ed5d 100644 --- a/pkgs/development/python-modules/web3/default.nix +++ b/pkgs/development/python-modules/web3/default.nix @@ -2,7 +2,8 @@ lib, buildPythonPackage, fetchFromGitHub, - pythonOlder, + setuptools, + # dependencies aiohttp, eth-abi, eth-account, @@ -14,22 +15,32 @@ jsonschema, lru-dict, protobuf, + pydantic, requests, + types-requests, websockets, + # nativeCheckInputs + eth-tester, + flaky, + hypothesis, + py-evm, + pytest-asyncio_0_21, + pytestCheckHook, + pytest-mock, + pytest-xdist, + pyunormalize, }: buildPythonPackage rec { pname = "web3"; - version = "6.5.0"; - format = "setuptools"; - - disabled = pythonOlder "3.7"; + version = "7.6.1"; + pyproject = true; src = fetchFromGitHub { owner = "ethereum"; repo = "web3.py"; - rev = "v${version}"; - hash = "sha256-RNWCZQjcse415SSNkHhMWckDcBJGFZnjisckF7gbYY8="; + tag = "v${version}"; + hash = "sha256-rpXSkQtqUZiCLMF2XlElbsjFjJmX+3j/NdAU2oaPU54="; }; # Note: to reflect the extra_requires in main/setup.py. @@ -37,7 +48,9 @@ buildPythonPackage rec { ipfs = [ ipfshttpclient ]; }; - propagatedBuildInputs = + build-system = [ setuptools ]; + + dependencies = [ aiohttp eth-abi @@ -52,16 +65,38 @@ buildPythonPackage rec { jsonschema lru-dict protobuf + pydantic requests + types-requests websockets ]; - # TODO: package eth-tester required for tests - doCheck = false; + nativeCheckInputs = [ + eth-tester + flaky + hypothesis + py-evm + pytest-asyncio_0_21 + pytestCheckHook + pytest-mock + pytest-xdist + pyunormalize + ]; + + 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" ];