diff --git a/pkgs/development/python-modules/ckzg/default.nix b/pkgs/development/python-modules/ckzg/default.nix new file mode 100644 index 000000000000..135c354d1224 --- /dev/null +++ b/pkgs/development/python-modules/ckzg/default.nix @@ -0,0 +1,60 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + clang, + # dependencies + pyyaml, + blst, + # checkPhase dependencies + python, +}: + +buildPythonPackage rec { + pname = "ckzg"; + version = "2.0.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "c-kzg-4844"; + tag = "v${version}"; + hash = "sha256-kOoodri80p5tz8RlMz6mqsZRAuXBxZm4vr+VWJEtfA0="; + }; + + build-system = [ setuptools ]; + + nativeBuildInputs = [ clang ]; + + dependencies = [ + pyyaml + blst + ]; + + postPatch = + # unvendor "blst" + '' + substituteInPlace setup.py \ + --replace-fail '"build_ext": CustomBuild,' "" + ''; + + checkPhase = '' + runHook preCheck + + cd bindings/python + ${python.interpreter} tests.py + + runHook postCheck + ''; + + pythonImportsCheck = [ "ckzg" ]; + + meta = { + description = "Minimal implementation of the Polynomial Commitments API for EIP-4844 and EIP-7594"; + homepage = "https://github.com/ethereum/c-kzg-4844"; + changelog = "https://github.com/ethereum/c-kzg-4844/releases/tag/v${version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ hellwolf ]; + }; +} diff --git a/pkgs/development/python-modules/eth-abi/default.nix b/pkgs/development/python-modules/eth-abi/default.nix index 2b5d28056208..0aa81ae68668 100644 --- a/pkgs/development/python-modules/eth-abi/default.nix +++ b/pkgs/development/python-modules/eth-abi/default.nix @@ -2,62 +2,56 @@ lib, buildPythonPackage, fetchFromGitHub, - eth-hash, + setuptools, + # dependencies eth-typing, eth-utils, - hypothesis, parsimonious, + # nativeCheckInputs + hypothesis, pytestCheckHook, - pythonOlder, + pytest-xdist, + eth-hash, }: buildPythonPackage rec { pname = "eth-abi"; - version = "4.1.0"; - format = "setuptools"; - disabled = pythonOlder "3.7"; + version = "5.1.0"; + pyproject = true; src = fetchFromGitHub { owner = "ethereum"; repo = "eth-abi"; - rev = "v${version}"; - hash = "sha256-CGAfu3Ovz2WPJOD+4W2+cOAz+wYvuIyFL333Jw66ozA="; + tag = "v${version}"; + hash = "sha256-D3aGMx2oZFttwQ90ouwQbbRelCb2bvyQgvamKweX9Nw="; }; - postPatch = '' - substituteInPlace setup.py \ - --replace "parsimonious>=0.9.0,<0.10.0" "parsimonious" - ''; + build-system = [ setuptools ]; - propagatedBuildInputs = [ + dependencies = [ eth-typing eth-utils parsimonious ]; - # lots of: TypeError: isinstance() arg 2 must be a type or tuple of types - doCheck = false; - nativeCheckInputs = [ hypothesis pytestCheckHook + pytest-xdist ] ++ eth-hash.optional-dependencies.pycryptodome; disabledTests = [ # boolean list representation changed "test_get_abi_strategy_returns_certain_strategies_for_known_type_strings" - # hypothesis.errors.Flaky - "test_base_equals_has_expected_behavior_for_parsable_types" - "test_has_arrlist_has_expected_behavior_for_parsable_types" - "test_is_base_tuple_has_expected_behavior_for_parsable_types" ]; pythonImportsCheck = [ "eth_abi" ]; - meta = with lib; { + meta = { description = "Ethereum ABI utilities"; homepage = "https://github.com/ethereum/eth-abi"; - license = licenses.mit; - maintainers = [ ]; + changelog = "https://github.com/ethereum/eth-abi/blob/v${version}/docs/release_notes.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hellwolf ]; }; } diff --git a/pkgs/development/python-modules/eth-account/default.nix b/pkgs/development/python-modules/eth-account/default.nix index 7be6722f233b..918100ec7f57 100644 --- a/pkgs/development/python-modules/eth-account/default.nix +++ b/pkgs/development/python-modules/eth-account/default.nix @@ -2,33 +2,42 @@ lib, buildPythonPackage, fetchFromGitHub, + setuptools, + # dependencies bitarray, + ckzg, eth-abi, eth-keyfile, eth-keys, eth-rlp, eth-utils, - websockets, hexbytes, - pythonOlder, rlp, + websockets, + # nativeCheckInputs + hypothesis, + pydantic, + pytestCheckHook, + pytest-xdist, }: buildPythonPackage rec { pname = "eth-account"; - version = "0.9.0"; - format = "setuptools"; - disabled = pythonOlder "3.7"; + version = "0.13.4"; + pyproject = true; src = fetchFromGitHub { owner = "ethereum"; repo = "eth-account"; - rev = "v${version}"; - hash = "sha256-Ps/vzJv0W1+wy1mSJaqRNNU6CoCMchReHIocB9kPrGs="; + tag = "v${version}"; + hash = "sha256-Y55WCgWJd2AaDNKbyBe9oi1soT19RdUjQWy5884Pcq8="; }; - propagatedBuildInputs = [ + build-system = [ setuptools ]; + + dependencies = [ bitarray + ckzg eth-abi eth-keyfile eth-keys @@ -39,15 +48,29 @@ buildPythonPackage rec { websockets ]; - # require buildinga npm project - doCheck = false; + nativeCheckInputs = [ + hypothesis + pydantic + pytestCheckHook + pytest-xdist + ]; + + disabledTests = [ + # requires local nodejs install + "test_messages_where_all_3_sigs_match" + "test_messages_where_eth_account_matches_ethers_but_not_metamask" + "test_messages_where_eth_account_matches_metamask_but_not_ethers" + # disable flaky fuzzing test + "test_compatibility" + ]; pythonImportsCheck = [ "eth_account" ]; - meta = with lib; { + meta = { description = "Account abstraction library for web3.py"; homepage = "https://github.com/ethereum/eth-account"; - license = licenses.mit; - maintainers = [ ]; + changelog = "https://github.com/ethereum/eth-account/blob/v${version}/docs/release_notes.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hellwolf ]; }; } diff --git a/pkgs/development/python-modules/eth-bloom/default.nix b/pkgs/development/python-modules/eth-bloom/default.nix new file mode 100644 index 000000000000..8c2a84e35908 --- /dev/null +++ b/pkgs/development/python-modules/eth-bloom/default.nix @@ -0,0 +1,50 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + # dependencies + eth-hash, + # nativeCheckInputs + hypothesis, + pytestCheckHook, + pytest-xdist, +}: + +buildPythonPackage rec { + pname = "eth-bloom"; + version = "3.1.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "eth-bloom"; + tag = "v${version}"; + hash = "sha256-WrBLFICPyb+1bIitHZ172A1p1VYqLR75YfJ5/IBqDr8="; + }; + + build-system = [ setuptools ]; + + dependencies = [ eth-hash ]; + + nativeCheckInputs = [ + hypothesis + pytestCheckHook + pytest-xdist + ] ++ eth-hash.optional-dependencies.pycryptodome; + + pythonImportsCheck = [ "eth_bloom" ]; + + disabledTests = [ + # not testable in nix build + "test_install_local_wheel" + ]; + + meta = { + description = "Implementation of the Ethereum bloom filter"; + homepage = "https://github.com/ethereum/eth-bloom"; + changelog = "https://github.com/ethereum/eth-bloom/blob/v${version}/CHANGELOG.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hellwolf ]; + }; +} diff --git a/pkgs/development/python-modules/eth-hash/default.nix b/pkgs/development/python-modules/eth-hash/default.nix index 241a4260e43a..cfd6365f6b1d 100644 --- a/pkgs/development/python-modules/eth-hash/default.nix +++ b/pkgs/development/python-modules/eth-hash/default.nix @@ -1,41 +1,51 @@ { lib, - fetchFromGitHub, buildPythonPackage, - pythonAtLeast, - pythonOlder, + fetchFromGitHub, + setuptools, + isPyPy, + # nativeCheckInputs pytest, - safe-pysha3, + pytest-xdist, + # optional dependencies pycryptodome, + safe-pysha3, }: buildPythonPackage rec { pname = "eth-hash"; - version = "0.5.2"; - format = "setuptools"; - disabled = pythonOlder "3.5"; + version = "0.7.1"; + pyproject = true; src = fetchFromGitHub { owner = "ethereum"; repo = "eth-hash"; - rev = "v${version}"; - hash = "sha256-6UN+kvLjjAtkmLgUaovjZC/6n3FZtXCwyXZH7ijQObU="; + tag = "v${version}"; + hash = "sha256-91jWZDqrd7ZZlM0D/3sDokJ26NiAQ3gdeBebTV1Lq8s="; }; - nativeCheckInputs = - [ pytest ] - ++ optional-dependencies.pycryptodome - # eth-hash can use either safe-pysha3 or pycryptodome; - # safe-pysha3 requires Python 3.9+ while pycryptodome does not. - # https://github.com/ethereum/eth-hash/issues/46#issuecomment-1314029211 - ++ lib.optional (pythonAtLeast "3.9") optional-dependencies.pysha3; + build-system = [ setuptools ]; + nativeCheckInputs = + [ + pytest + pytest-xdist + ] + ++ optional-dependencies.pycryptodome + # safe-pysha3 is not available on pypy + ++ lib.optional (!isPyPy) optional-dependencies.pysha3; + + # Backends need to be tested separatly and can not use hook checkPhase = '' - pytest tests/backends/pycryptodome/ + runHook preCheck + pytest tests/core tests/backends/pycryptodome '' - + lib.optionalString (pythonAtLeast "3.9") '' - pytest tests/backends/pysha3/ + + lib.optionalString (!isPyPy) '' + pytest tests/backends/pysha3 + '' + + '' + runHook postCheck ''; optional-dependencies = { @@ -43,10 +53,11 @@ buildPythonPackage rec { pysha3 = [ safe-pysha3 ]; }; - meta = with lib; { + meta = { description = "Ethereum hashing function keccak256"; homepage = "https://github.com/ethereum/eth-hash"; - license = licenses.mit; - maintainers = [ ]; + changelog = "https://github.com/ethereum/eth-hash/blob/v${version}/docs/release_notes.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hellwolf ]; }; } diff --git a/pkgs/development/python-modules/eth-keyfile/default.nix b/pkgs/development/python-modules/eth-keyfile/default.nix index 8175b2cfe761..0d16bc1ff21a 100644 --- a/pkgs/development/python-modules/eth-keyfile/default.nix +++ b/pkgs/development/python-modules/eth-keyfile/default.nix @@ -3,30 +3,30 @@ buildPythonPackage, fetchFromGitHub, setuptools, + # dependencies eth-keys, eth-utils, pycryptodome, + # nativeCheckInputs pytestCheckHook, - pythonOlder, }: buildPythonPackage rec { pname = "eth-keyfile"; - version = "0.8.0"; + version = "0.8.1"; pyproject = true; - disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "ethereum"; repo = "eth-keyfile"; - rev = "v${version}"; + tag = "v${version}"; fetchSubmodules = true; - hash = "sha256-797yhHuU9/lm96YKxl3SZ5IQAwDxDSYkLkiBdAHh0Uk="; + hash = "sha256-HufsN3aXdQErcQmnG2PZnEm5joqpy4f8IWNm3VrzJSY="; }; build-system = [ setuptools ]; - propagatedBuildInputs = [ + dependencies = [ eth-keys eth-utils pycryptodome @@ -36,10 +36,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "eth_keyfile" ]; - meta = with lib; { + meta = { description = "Tools for handling the encrypted keyfile format used to store private keys"; homepage = "https://github.com/ethereum/eth-keyfile"; - license = licenses.mit; - maintainers = [ ]; + changelog = "https://github.com/ethereum/eth-keyfile/blob/v${version}/CHANGELOG.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hellwolf ]; }; } diff --git a/pkgs/development/python-modules/eth-keys/default.nix b/pkgs/development/python-modules/eth-keys/default.nix index c64470a2c485..95965af550f0 100644 --- a/pkgs/development/python-modules/eth-keys/default.nix +++ b/pkgs/development/python-modules/eth-keys/default.nix @@ -1,37 +1,37 @@ { lib, - buildPythonPackage, fetchFromGitHub, + buildPythonPackage, setuptools, - asn1tools, - coincurve, - eth-hash, + # dependencies eth-typing, eth-utils, + # nativeCheckInputs + asn1tools, factory-boy, hypothesis, - isPyPy, pyasn1, pytestCheckHook, - pythonOlder, + coincurve, + eth-hash, + isPyPy, }: buildPythonPackage rec { pname = "eth-keys"; - version = "0.5.0"; + version = "0.6.0"; pyproject = true; - disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "ethereum"; repo = "eth-keys"; - rev = "v${version}"; - hash = "sha256-vyyaLCG2uIHXX0t93DmFq8/u0rZL+nsBsH2gfgjziyo="; + tag = "v${version}"; + hash = "sha256-HyOfuzwldtqjjowW7HGdZ8RNMXNK3y2NrXUoeMlWJjs="; }; build-system = [ setuptools ]; - propagatedBuildInputs = [ + dependencies = [ eth-typing eth-utils ]; @@ -48,29 +48,17 @@ buildPythonPackage rec { ++ lib.optional (!isPyPy) eth-hash.optional-dependencies.pysha3 ++ lib.optional isPyPy eth-hash.optional-dependencies.pycryptodome; - disabledTests = [ - # tests are broken - "test_compress_decompress_inversion" - "test_public_key_generation_is_equal" - "test_signing_is_equal" - "test_native_to_coincurve_recover" - "test_public_key_compression_is_equal" - "test_public_key_decompression_is_equal" - "test_signatures_with_high_s" - # timing sensitive - "test_encode_decode_pairings" - ]; - pythonImportsCheck = [ "eth_keys" ]; optional-dependencies = { coincurve = [ coincurve ]; }; - meta = with lib; { + meta = { description = "Common API for Ethereum key operations"; homepage = "https://github.com/ethereum/eth-keys"; - license = licenses.mit; - maintainers = [ ]; + changelog = "https://github.com/ethereum/eth-keys/blob/v${version}/CHANGELOG.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hellwolf ]; }; } diff --git a/pkgs/development/python-modules/eth-tester/default.nix b/pkgs/development/python-modules/eth-tester/default.nix new file mode 100644 index 000000000000..7d2210c5450b --- /dev/null +++ b/pkgs/development/python-modules/eth-tester/default.nix @@ -0,0 +1,59 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + # dependencies + eth-abi, + eth-account, + eth-keys, + eth-utils, + pydantic, + rlp, + semantic-version, + # nativeCheckInputs + py-evm, + pytestCheckHook, + pytest-xdist, +}: + +buildPythonPackage rec { + pname = "eth-tester"; + version = "0.12.0-beta.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "eth-tester"; + tag = "v${version}"; + hash = "sha256-ox7adsqD0MPZFcxBhino8cgwYYEWrBnD+ugPQOuOO2U="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + eth-abi + eth-account + eth-keys + eth-utils + pydantic + rlp + semantic-version + ]; + + nativeCheckInputs = [ + py-evm + pytestCheckHook + pytest-xdist + ]; + + pythonImportsCheck = [ "eth_tester" ]; + + meta = { + description = "Tool suite for testing ethereum applications"; + homepage = "https://github.com/ethereum/eth-tester"; + changelog = "https://github.com/ethereum/eth-tester/blob/v${version}/CHANGELOG.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hellwolf ]; + }; +} diff --git a/pkgs/development/python-modules/eth-typing/default.nix b/pkgs/development/python-modules/eth-typing/default.nix index 0bc0c8f69bd6..19d4101c83c3 100644 --- a/pkgs/development/python-modules/eth-typing/default.nix +++ b/pkgs/development/python-modules/eth-typing/default.nix @@ -1,40 +1,48 @@ { lib, - fetchFromGitHub, buildPythonPackage, - pythonOlder, - pytestCheckHook, - typing-extensions, + fetchFromGitHub, setuptools, + # dependencies + typing-extensions, + # nativeCheckInputs + pytestCheckHook, + pytest-xdist, }: buildPythonPackage rec { pname = "eth-typing"; - version = "5.0.1"; + version = "5.1.0"; pyproject = true; - disabled = pythonOlder "3.6"; - src = fetchFromGitHub { owner = "ethereum"; repo = "eth-typing"; tag = "v${version}"; - hash = "sha256-WFTx5u85Gp+jQPWS3BTk1Pky07C2fVAzwrG/c3hSRzM="; + hash = "sha256-IOWd6WFPAYO+VZwlMilRVHtudEjHt5p8Xu4WloFB/ww="; }; build-system = [ setuptools ]; - nativeCheckInputs = [ pytestCheckHook ]; - dependencies = [ typing-extensions ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-xdist + ]; + pythonImportsCheck = [ "eth_typing" ]; - meta = with lib; { + disabledTests = [ + # side-effect: runs pip online check and is blocked by sandbox + "test_install_local_wheel" + ]; + + meta = { description = "Common type annotations for Ethereum Python packages"; homepage = "https://github.com/ethereum/eth-typing"; changelog = "https://github.com/ethereum/eth-typing/blob/v${version}/docs/release_notes.rst"; - license = licenses.mit; - maintainers = with maintainers; [ siraben ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ siraben ]; }; } diff --git a/pkgs/development/python-modules/eth-utils/default.nix b/pkgs/development/python-modules/eth-utils/default.nix index feb07cbac013..b170e2443b30 100644 --- a/pkgs/development/python-modules/eth-utils/default.nix +++ b/pkgs/development/python-modules/eth-utils/default.nix @@ -1,33 +1,33 @@ { lib, - fetchFromGitHub, buildPythonPackage, + fetchFromGitHub, + setuptools, + isPyPy, + # dependencies eth-hash, eth-typing, cytoolz, - hypothesis, - isPyPy, - pytestCheckHook, - pythonOlder, - setuptools, toolz, + # nativeCheckInputs + hypothesis, mypy, + pytestCheckHook, }: buildPythonPackage rec { pname = "eth-utils"; version = "5.1.0"; pyproject = true; - disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "ethereum"; repo = "eth-utils"; - rev = "v${version}"; + tag = "v${version}"; hash = "sha256-uPzg1gUEsulQL2u22R/REHWx1ZtbMxvcXf6UgWqkDF4="; }; - nativeBuildInputs = [ setuptools ]; + build-system = [ setuptools ]; propagatedBuildInputs = [ @@ -39,8 +39,8 @@ buildPythonPackage rec { nativeCheckInputs = [ hypothesis - pytestCheckHook mypy + pytestCheckHook ] ++ eth-hash.optional-dependencies.pycryptodome; pythonImportsCheck = [ "eth_utils" ]; diff --git a/pkgs/development/python-modules/py-evm/default.nix b/pkgs/development/python-modules/py-evm/default.nix new file mode 100644 index 000000000000..73ae873bcfca --- /dev/null +++ b/pkgs/development/python-modules/py-evm/default.nix @@ -0,0 +1,78 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + # dependencies + cached-property, + ckzg, + eth-bloom, + eth-keys, + eth-typing, + eth-utils, + lru-dict, + pydantic, + py-ecc, + rlp, + trie, + # nativeCheckInputs + factory-boy, + hypothesis, + pytestCheckHook, + pytest-xdist, + eth-hash, +}: + +buildPythonPackage rec { + pname = "py-evm"; + version = "0.10.1-beta.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "py-evm"; + tag = "v${version}"; + hash = "sha256-2BWMen/6ZcL1/SgGP0XcrTC63+LEjZO7Ogb3anhavsE="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + cached-property + ckzg + eth-bloom + eth-keys + eth-typing + eth-utils + lru-dict + py-ecc + rlp + trie + ]; + + nativeCheckInputs = [ + factory-boy + hypothesis + pytestCheckHook + pytest-xdist + ] ++ eth-hash.optional-dependencies.pycryptodome; + + disabledTests = [ + # side-effect: runs pip online check and is blocked by sandbox + "test_install_local_wheel" + ]; + + disabledTestPaths = [ + # json-fixtures require fixture submodule and execution spec + "tests/json-fixtures" + ]; + + pythonImportsCheck = [ "eth" ]; + + meta = { + description = "A Python implementation of the Ethereum Virtual Machine."; + homepage = "https://github.com/ethereum/py-evm"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hellwolf ]; + }; +} diff --git a/pkgs/development/python-modules/pyunormalize/default.nix b/pkgs/development/python-modules/pyunormalize/default.nix new file mode 100644 index 000000000000..450eb8ebd4e2 --- /dev/null +++ b/pkgs/development/python-modules/pyunormalize/default.nix @@ -0,0 +1,37 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, + # nativeCheckInputs + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "pyunormalize"; + version = "16.0.0"; + pyproject = true; + + # No tags on GitHub + src = fetchPypi { + inherit pname version; + hash = "sha256-Lh37tKEYFUrib3BxBCalKjZLkmyRkfdkYB9ajLEnYfc="; + }; + + build-system = [ setuptools ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + # The pypi archive does not contain the tests. + # NOTE: one should review this for each future update. + doCheck = false; + + pythonImportsCheck = [ "pyunormalize" ]; + + meta = { + description = "Unicode normalization forms (NFC, NFKC, NFD, NFKD) independent of the Python core Unicode database"; + homepage = "https://github.com/mlodewijck/pyunormalize"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hellwolf ]; + }; +} diff --git a/pkgs/development/python-modules/trie/default.nix b/pkgs/development/python-modules/trie/default.nix new file mode 100644 index 000000000000..261cc26df341 --- /dev/null +++ b/pkgs/development/python-modules/trie/default.nix @@ -0,0 +1,63 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + # dependencies + eth-hash, + eth-utils, + hexbytes, + rlp, + sortedcontainers, + # nativeCheckInputs + hypothesis, + pytestCheckHook, + pytest-xdist, +}: + +buildPythonPackage rec { + pname = "trie"; + version = "3.0.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "py-trie"; + tag = "v${version}"; + hash = "sha256-kG/5ijckiEOfB5y1c3Yqudqnb1MDbPD25YZZM+H13Lw="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + eth-hash + eth-utils + hexbytes + rlp + sortedcontainers + ]; + + nativeCheckInputs = [ + hypothesis + pytestCheckHook + pytest-xdist + ] ++ eth-hash.optional-dependencies.pycryptodome; + + disabledTests = [ + # some core tests require fixture submodule and execution spec + "test_fixtures_exist" + "test_bin_trie_update_value" + "test_branch_updates" + ]; + disabledTestPaths = [ "tests/core/test_iter.py" ]; + + pythonImportsCheck = [ "trie" ]; + + meta = { + description = "Python library which implements the Ethereum Trie structure"; + homepage = "https://github.com/ethereum/py-trie"; + changelog = "https://github.com/ethereum/py-trie/blob/v${version}/CHANGELOG.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hellwolf ]; + }; +} diff --git a/pkgs/development/python-modules/web3/default.nix b/pkgs/development/python-modules/web3/default.nix index 08fc850f9e50..df894986b3ed 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 + ]; - postPatch = '' - substituteInPlace setup.py --replace "types-protobuf==3.19.13" "types-protobuf" - ''; + 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" + ]; + + disabledTestPaths = [ + # requires geth library and binaries + "tests/integration/go_ethereum" + # requires local running beacon node + "tests/beacon" + ]; pythonImportsCheck = [ "web3" ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1eba0231e4ef..13394a2a461c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2336,6 +2336,8 @@ self: super: with self; { ckcc-protocol = callPackage ../development/python-modules/ckcc-protocol { }; + ckzg = callPackage ../development/python-modules/ckzg { }; + clarabel = callPackage ../development/python-modules/clarabel { }; clarifai = callPackage ../development/python-modules/clarifai { }; @@ -4264,6 +4266,8 @@ self: super: with self; { eth-account = callPackage ../development/python-modules/eth-account { }; + eth-bloom = callPackage ../development/python-modules/eth-bloom { }; + eth-hash = callPackage ../development/python-modules/eth-hash { }; eth-keyfile = callPackage ../development/python-modules/eth-keyfile { }; @@ -4272,6 +4276,8 @@ self: super: with self; { eth-rlp = callPackage ../development/python-modules/eth-rlp { }; + eth-tester = callPackage ../development/python-modules/eth-tester { }; + eth-typing = callPackage ../development/python-modules/eth-typing { }; eth-utils = callPackage ../development/python-modules/eth-utils { }; @@ -9502,6 +9508,8 @@ self: super: with self; { py-eth-sig-utils = callPackage ../development/python-modules/py-eth-sig-utils { }; + py-evm = callPackage ../development/python-modules/py-evm { }; + py-expression-eval = callPackage ../development/python-modules/py-expression-eval { }; py-improv-ble-client = callPackage ../development/python-modules/py-improv-ble-client { }; @@ -10869,6 +10877,8 @@ self: super: with self; { pyunpack = callPackage ../development/python-modules/pyunpack { }; + pyunormalize = callPackage ../development/python-modules/pyunormalize { }; + pyutil = callPackage ../development/python-modules/pyutil { }; pyzbar = callPackage ../development/python-modules/pyzbar { }; @@ -16499,6 +16509,8 @@ self: super: with self; { trezor = callPackage ../development/python-modules/trezor { }; + trie = callPackage ../development/python-modules/trie { }; + trimesh = callPackage ../development/python-modules/trimesh { }; trino-python-client = callPackage ../development/python-modules/trino-python-client { };