From 0cdcc2dad2ad15a53e97a6cde3cd1a70e057e4d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 1 Jun 2022 19:47:01 +0200 Subject: [PATCH 01/19] python310Packages.autobahn: 22.3.2 -> 22.4.2 --- .../python-modules/autobahn/default.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/autobahn/default.nix b/pkgs/development/python-modules/autobahn/default.nix index 5fd6f1a3b8f9..83276252eee3 100644 --- a/pkgs/development/python-modules/autobahn/default.nix +++ b/pkgs/development/python-modules/autobahn/default.nix @@ -1,5 +1,6 @@ { lib , buildPythonPackage +, fetchpatch , fetchPypi , attrs , argon2-cffi @@ -47,16 +48,28 @@ buildPythonPackage rec { pname = "autobahn"; - version = "22.3.2"; + version = "22.4.2"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-WKiHx6GWuwjYtmJMs2lfSTqeXJ8A/TUNjW+Cm0f/kDY="; + sha256 = "sha256-V7es8ijVDYPPMnNyuInioWioaSdbJuF5F+0LTPTYI6Y="; }; + patches = [ + # fix txaio compatibility + (fetchpatch { + url = "https://github.com/crossbario/autobahn-python/commit/2e2ee5f9775ed312db699f5c55fc0488311735a5.patch"; + excludes = [ + "setup.py" + "tox.ini" + ]; + sha256 = "sha256-LQSusXZwDpxyQl4tphZovaYceg/JVG0SyoA9FUQlVWU="; + }) + ]; + propagatedBuildInputs = [ cryptography hyperlink From 8d5a2017caf821fa13e129280a76ba2aeaff3c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 02:36:18 +0200 Subject: [PATCH 02/19] python310Packages.buildbot: fix tests --- pkgs/development/python-modules/buildbot/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/buildbot/default.nix b/pkgs/development/python-modules/buildbot/default.nix index acbfb15cfca5..a49c7d6c2f2d 100644 --- a/pkgs/development/python-modules/buildbot/default.nix +++ b/pkgs/development/python-modules/buildbot/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, buildPythonPackage, fetchPypi, makeWrapper, isPy3k +{ stdenv, lib, buildPythonPackage, fetchpatch, fetchPypi, makeWrapper, isPy3k , python, twisted, jinja2, msgpack, zope_interface, sqlalchemy, alembic , python-dateutil, txaio, autobahn, pyjwt, pyyaml, treq, txrequests, pypugjs , boto3, moto, mock, lz4, setuptoolsTrial, isort, pylint, flake8 @@ -81,6 +81,11 @@ let # This patch disables the test that tries to read /etc/os-release which # is not accessible in sandboxed builds. ./skip_test_linux_distro.patch + (fetchpatch{ + url = "https://github.com/buildbot/buildbot/commit/54b8f62902122b0091319a96d0f9edd4195ab4c6.patch"; + stripLen = 1; + sha256 = "sha256-OqW3ZQK0bfqPG3YlrBbrSEEKsM/XqY2NO862ZD/DgHs="; + }) ]; postPatch = '' From f5bedc25b2e35911dfe6abd55f581e485493cfe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 03:03:52 +0200 Subject: [PATCH 03/19] python310Packages.py-eth-sig-utils: init at 0.4.0 --- .../py-eth-sig-utils/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/py-eth-sig-utils/default.nix diff --git a/pkgs/development/python-modules/py-eth-sig-utils/default.nix b/pkgs/development/python-modules/py-eth-sig-utils/default.nix new file mode 100644 index 000000000000..1dfc8904fe00 --- /dev/null +++ b/pkgs/development/python-modules/py-eth-sig-utils/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, eth-abi +, py-ecc +, pycryptodome +, python +, rlp +}: + +buildPythonPackage rec { + pname = "py-eth-sig-utils"; + version = "0.4.0"; + + src = fetchFromGitHub { + owner = "rmeissner"; + repo = "py-eth-sig-utils"; + rev = "v${version}"; + sha256 = "sha256-PNvEHH5w2ptntRGzqWrqlbIzJJsT60OXg/Dh5f6Wq9k="; + }; + + propagatedBuildInputs = [ + eth-abi + py-ecc + pycryptodome + rlp + ]; + + checkPhase = '' + ${python.interpreter} -m unittest + ''; + + pythonImportsCheck = [ "py_eth_sig_utils" ]; + + meta = with lib; { + description = "Collection of functions to generate hashes for signing on Ethereum"; + homepage = "https://github.com/rmeissner/py-eth-sig-utils"; + license = licenses.mit; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 924884839151..71c3b284e9ba 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5931,6 +5931,8 @@ in { py-deprecate = callPackage ../development/python-modules/py-deprecate { }; + py-eth-sig-utils = callPackage ../development/python-modules/py-eth-sig-utils { }; + nwdiag = callPackage ../development/python-modules/nwdiag { }; oasatelematics = callPackage ../development/python-modules/oasatelematics { }; From 2de83832fbe2b314d9c9019d46c4a5542e3f154c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 03:19:16 +0200 Subject: [PATCH 04/19] python310Packages.eth-abi: init at 3.0.0 --- .../python-modules/eth-abi/default.nix | 57 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/eth-abi/default.nix diff --git a/pkgs/development/python-modules/eth-abi/default.nix b/pkgs/development/python-modules/eth-abi/default.nix new file mode 100644 index 000000000000..1e81450764f0 --- /dev/null +++ b/pkgs/development/python-modules/eth-abi/default.nix @@ -0,0 +1,57 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, eth-hash +, eth-typing +, eth-utils +, hypothesis +, parsimonious +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "eth-abi"; + version = "3.0.0"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "eth-abi"; + rev = "v${version}"; + sha256 = "sha256-qiuyGVOy+n8l3jSqwMGnBXcDrOxIiJ0lNP4lq/EQEhU="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace "parsimonious>=0.8.0,<0.9.0" "parsimonious" + ''; + + propagatedBuildInputs = [ + eth-typing + eth-utils + parsimonious + ]; + + checkInputs = [ + hypothesis + pytestCheckHook + ] ++ 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_has_arrlist_has_expected_behavior_for_parsable_types" + "test_is_base_tuple_has_expected_behavior_for_parsable_types" + ]; + + pythonImportsCheck = [ "eth_abi" ]; + + meta = with lib; { + description = "Ethereum ABI utilities"; + homepage = "https://github.com/ethereum/eth-abi"; + license = licenses.mit; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 71c3b284e9ba..1e1cf19c8f56 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2803,6 +2803,8 @@ in { etesync = callPackage ../development/python-modules/etesync { }; + eth-abi = callPackage ../development/python-modules/eth-abi { }; + eth-hash = callPackage ../development/python-modules/eth-hash { }; eth-typing = callPackage ../development/python-modules/eth-typing { }; From 07a12b703f6f1fed814ad48d4c3b890ef696673e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 03:21:28 +0200 Subject: [PATCH 05/19] python310Packages.py-ecc: init at 6.0.0 --- .../python-modules/py-ecc/default.nix | 43 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/py-ecc/default.nix diff --git a/pkgs/development/python-modules/py-ecc/default.nix b/pkgs/development/python-modules/py-ecc/default.nix new file mode 100644 index 000000000000..8060ab45cae1 --- /dev/null +++ b/pkgs/development/python-modules/py-ecc/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, cached-property +, eth-typing +, eth-utils +, mypy-extensions +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "py-ecc"; + version = "6.0.0"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "py_ecc"; + rev = "v${version}"; + sha256 = "sha256-638otYA3e/Ld4mcM69yrqHQnGoK/Sfl/UA9FWnjgO/U="; + }; + + propagatedBuildInputs = [ + cached-property + eth-typing + eth-utils + mypy-extensions + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "py_ecc" ]; + + meta = with lib; { + description = "ECC pairing and bn_128 and bls12_381 curve operations"; + homepage = "https://github.com/ethereum/py_ecc"; + license = licenses.mit; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1e1cf19c8f56..6822d01d4f94 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5933,6 +5933,8 @@ in { py-deprecate = callPackage ../development/python-modules/py-deprecate { }; + py-ecc = callPackage ../development/python-modules/py-ecc { }; + py-eth-sig-utils = callPackage ../development/python-modules/py-eth-sig-utils { }; nwdiag = callPackage ../development/python-modules/nwdiag { }; From 8d1e34700b075ec0c67b6002110627bd737f4467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 03:58:22 +0200 Subject: [PATCH 06/19] python310Packages.eth-account: init at 0.6.1 --- .../python-modules/eth-account/default.nix | 54 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 56 insertions(+) create mode 100644 pkgs/development/python-modules/eth-account/default.nix diff --git a/pkgs/development/python-modules/eth-account/default.nix b/pkgs/development/python-modules/eth-account/default.nix new file mode 100644 index 000000000000..1a929ca9099f --- /dev/null +++ b/pkgs/development/python-modules/eth-account/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, bitarray +, eth-abi +, eth-keyfile +, eth-keys +, eth-rlp +, eth-utils +, hexbytes +, pythonOlder +, rlp +}: + +buildPythonPackage rec { + pname = "eth-account"; + version = "0.6.1"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "eth-account"; + rev = "v${version}"; + sha256 = "sha256-cjQvTKC4lDbKnAvbmnTGHQiJZsZFhXc/+UH5rUdlGxs="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace "bitarray>=1.2.1,<1.3.0" "bitarray>=2.4.0,<3" + ''; + + propagatedBuildInputs = [ + bitarray + eth-abi + eth-keyfile + eth-keys + eth-rlp + eth-utils + hexbytes + rlp + ]; + + # require buildinga npm project + doCheck = false; + + pythonImportsCheck = [ "eth_account" ]; + + meta = with lib; { + description = "Account abstraction library for web3.py"; + homepage = "https://github.com/ethereum/eth-account"; + license = licenses.mit; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6822d01d4f94..4566e653ad0f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2805,6 +2805,8 @@ in { eth-abi = callPackage ../development/python-modules/eth-abi { }; + eth-account = callPackage ../development/python-modules/eth-account { }; + eth-hash = callPackage ../development/python-modules/eth-hash { }; eth-typing = callPackage ../development/python-modules/eth-typing { }; From 8c400570aa4407cd6294aadb659fc2d3b54f8db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 04:03:50 +0200 Subject: [PATCH 07/19] python310Packages.eth-keyfile: init at 0.6.0 --- .../python-modules/eth-keyfile/default.nix | 47 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/eth-keyfile/default.nix diff --git a/pkgs/development/python-modules/eth-keyfile/default.nix b/pkgs/development/python-modules/eth-keyfile/default.nix new file mode 100644 index 000000000000..fd62501b81d2 --- /dev/null +++ b/pkgs/development/python-modules/eth-keyfile/default.nix @@ -0,0 +1,47 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, eth-keys +, eth-utils +, pycryptodome +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "eth-keyfile"; + version = "0.6.0"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "eth-keyfile"; + rev = "v${version}"; + fetchSubmodules = true; + sha256 = "sha256-JD4bRoD9L0JXcd+bTZrq/BkWw5QGzOi1RvoyLJC77kk="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace "'setuptools-markdown'" "" + ''; + + propagatedBuildInputs = [ + eth-keys + eth-utils + pycryptodome + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "eth_keyfile" ]; + + meta = with lib; { + description = "Tools for handling the encrypted keyfile format used to store private keys"; + homepage = "https://github.com/ethereum/eth-keyfile"; + license = licenses.mit; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4566e653ad0f..d94f940335f4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2809,6 +2809,8 @@ in { eth-hash = callPackage ../development/python-modules/eth-hash { }; + eth-keyfile = callPackage ../development/python-modules/eth-keyfile { }; + eth-typing = callPackage ../development/python-modules/eth-typing { }; eth-utils = callPackage ../development/python-modules/eth-utils { }; From 02b136a85d5dd1cfa62e5e3efbfce01a86218d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 04:04:45 +0200 Subject: [PATCH 08/19] python310Packages.eth-utils: adopt, cleanup --- .../python-modules/eth-utils/default.nix | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/eth-utils/default.nix b/pkgs/development/python-modules/eth-utils/default.nix index 9b26fb7024c0..a5b19123c1ec 100644 --- a/pkgs/development/python-modules/eth-utils/default.nix +++ b/pkgs/development/python-modules/eth-utils/default.nix @@ -1,12 +1,21 @@ -{ lib, fetchFromGitHub, buildPythonPackage, pytestCheckHook, eth-hash, eth-typing, - cytoolz, hypothesis }: +{ lib +, fetchFromGitHub +, buildPythonPackage +, eth-hash +, eth-typing +, cytoolz +, hypothesis +, isPyPy +, pytestCheckHook +, pythonOlder +, toolz +}: buildPythonPackage rec { pname = "eth-utils"; version = "2.0.0"; + disabled = pythonOlder "3.6"; - # Tests are missing from the PyPI source tarball so let's use GitHub - # https://github.com/ethereum/eth-utils/issues/130 src = fetchFromGitHub { owner = "ethereum"; repo = pname; @@ -14,8 +23,17 @@ buildPythonPackage rec { sha256 = "sha256-E2vUROc2FcAv00k50YpdxaaYIRDk1yGSPB8cHHw+7Yw="; }; - checkInputs = [ pytestCheckHook hypothesis ]; - propagatedBuildInputs = [ eth-hash eth-typing cytoolz ]; + propagatedBuildInputs = [ + eth-hash + eth-typing + ] ++ lib.optional (!isPyPy) cytoolz + ++ lib.optional isPyPy toolz; + + + checkInputs = [ + hypothesis + pytestCheckHook + ] ++ eth-hash.optional-dependencies.pycryptodome; pythonImportsCheck = [ "eth_utils" ]; @@ -23,6 +41,6 @@ buildPythonPackage rec { description = "Common utility functions for codebases which interact with ethereum"; homepage = "https://github.com/ethereum/eth-utils"; license = lib.licenses.mit; - maintainers = with lib.maintainers; [ jluttine ]; + maintainers = with lib.maintainers; [ SuperSandro2000 ]; }; } From a380aae71c0dd050805a54ec2c49ed40dc383840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 04:32:43 +0200 Subject: [PATCH 09/19] python310Packages.eth-hash: adopt, cleanup --- .../python-modules/eth-hash/default.nix | 58 ++++++++----------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/pkgs/development/python-modules/eth-hash/default.nix b/pkgs/development/python-modules/eth-hash/default.nix index 622dd0b37353..1c60a2d59489 100644 --- a/pkgs/development/python-modules/eth-hash/default.nix +++ b/pkgs/development/python-modules/eth-hash/default.nix @@ -1,55 +1,43 @@ -{ lib, fetchPypi, buildPythonPackage, pythonOlder, pytest, pysha3, pycrypto +{ lib +, fetchFromGitHub +, buildPythonPackage +, pythonOlder +, pytest +, pysha3 , pycryptodome }: buildPythonPackage rec { pname = "eth-hash"; version = "0.3.2"; + disabled = pythonOlder "3.5"; - src = fetchPypi { - inherit pname version; - sha256 = "3f40cecd5ead88184aa9550afc19d057f103728108c5102f592f8415949b5a76"; + src = fetchFromGitHub { + owner = "ethereum"; + repo = "eth-hash"; + rev = "v${version}"; + sha256 = "sha256-LMDtFUrsPYgj/Fl9aBW1todlj1D3LlFxAkzNFAzCGLQ="; }; - checkInputs = [ pytest ]; + checkInputs = [ + pytest + ] ++ passthru.optional-dependencies.pycryptodome + ++ passthru.optional-dependencies.pysha3; - propagatedBuildInputs = [ - pysha3 - pycrypto - pycryptodome - ]; - - pipInstallFlags = [ - # Circular dependency on eth-utils - "--no-dependencies" - ]; - - # setuptools-markdown uses pypandoc which is broken at the moment - preConfigure = '' - substituteInPlace setup.py --replace \'setuptools-markdown\' "" - ''; - - # Run tests separately because we don't want to run tests on tests/backends/ - # but only on its selected subdirectories. Also, the directories under - # tests/backends/ must be run separately because they have identically named - # test files so pytest would raise errors because of that. - # - # Also, tests in tests/core/test_import.py are broken so just ignore them: - # https://github.com/ethereum/eth-hash/issues/25 - # There is a pull request to fix the tests: - # https://github.com/ethereum/eth-hash/pull/26 checkPhase = '' pytest tests/backends/pycryptodome/ pytest tests/backends/pysha3/ - # pytest tests/core/ ''; - disabled = pythonOlder "3.5"; + passthru.optional-dependencies = { + pycryptodome = [ pycryptodome ]; + pysha3 = [ pysha3 ]; + }; - meta = { + meta = with lib; { description = "The Ethereum hashing function keccak256"; homepage = "https://github.com/ethereum/eth-hash"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ jluttine ]; + license = licenses.mit; + maintainers = with maintainers; [ SuperSandro2000 ]; }; } From 98f3569f4fe8b11a462eb95ca30d83f821fd2ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 04:33:00 +0200 Subject: [PATCH 10/19] python310Packages.eth-typing: adopt, cleanup --- .../python-modules/eth-typing/default.nix | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/eth-typing/default.nix b/pkgs/development/python-modules/eth-typing/default.nix index c98a0fc51529..a2f3103be47d 100644 --- a/pkgs/development/python-modules/eth-typing/default.nix +++ b/pkgs/development/python-modules/eth-typing/default.nix @@ -1,35 +1,32 @@ -{ lib, fetchFromGitHub, buildPythonPackage, pythonOlder, pytest }: +{ lib +, fetchFromGitHub +, buildPythonPackage +, pythonOlder +, pytestCheckHook +}: buildPythonPackage rec { pname = "eth-typing"; version = "3.0.0"; + disabled = pythonOlder "3.6"; - # Tests are missing from the PyPI source tarball so let's use GitHub - # https://github.com/ethereum/eth-typing/issues/8 src = fetchFromGitHub { owner = "ethereum"; - repo = pname; + repo = "eth-typing"; rev = "v${version}"; sha256 = "sha256-9rrnDFPWAmrUkr2mVTVi/8DTJdg4hzGaU0UbpwG5mtY="; }; - # setuptools-markdown uses pypandoc which is broken at the moment - preConfigure = '' - substituteInPlace setup.py --replace \'setuptools-markdown\' "" - ''; + checkInputs = [ + pytestCheckHook + ]; - disabled = pythonOlder "3.5"; - - checkInputs = [ pytest ]; - - checkPhase = '' - pytest . - ''; + pythonImportsCheck = [ "eth_typing" ]; meta = { description = "Common type annotations for Ethereum Python packages"; homepage = "https://github.com/ethereum/eth-typing"; license = lib.licenses.mit; - maintainers = with lib.maintainers; [ jluttine ]; + maintainers = with lib.maintainers; [ SuperSandro2000 ]; }; } From ded901634f89751c268413632323b309a1b71771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 04:33:28 +0200 Subject: [PATCH 11/19] python310Packages.eth-keys: init at 0.4.0 --- .../python-modules/eth-keys/default.nix | 56 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/development/python-modules/eth-keys/default.nix diff --git a/pkgs/development/python-modules/eth-keys/default.nix b/pkgs/development/python-modules/eth-keys/default.nix new file mode 100644 index 000000000000..efdde22b8b90 --- /dev/null +++ b/pkgs/development/python-modules/eth-keys/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, asn1tools +, coincurve +, eth-hash +, eth-typing +, eth-utils +, factory_boy +, hypothesis +, isPyPy +, pyasn1 +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "eth-keys"; + version = "0.4.0"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "eth-keys"; + rev = "v${version}"; + sha256 = "sha256-jG/jJPM4t3z6UQIdc8L6y0DxZiGx5pVuGL8XwbIt60o="; + }; + + propagatedBuildInputs = [ + eth-typing + eth-utils + ]; + + checkInputs = [ + asn1tools + factory_boy + hypothesis + pyasn1 + pytestCheckHook + ] ++ passthru.optional-dependencies.coincurve + ++ lib.optional (!isPyPy) eth-hash.optional-dependencies.pysha3 + ++ lib.optional isPyPy eth-hash.optional-dependencies.pycryptodome; + + pythonImportsCheck = [ "eth_keys" ]; + + passthru.optional-dependencies = { + coincurve = [ coincurve ]; + }; + + meta = with lib; { + description = "Common API for Ethereum key operations"; + homepage = "https://github.com/ethereum/eth-keys"; + license = licenses.mit; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d94f940335f4..b5103dbcc9c0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2811,6 +2811,8 @@ in { eth-keyfile = callPackage ../development/python-modules/eth-keyfile { }; + eth-keys = callPackage ../development/python-modules/eth-keys { }; + eth-typing = callPackage ../development/python-modules/eth-typing { }; eth-utils = callPackage ../development/python-modules/eth-utils { }; From a5985571ca2026a509f1c31bcde36f35aeed907a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 04:46:44 +0200 Subject: [PATCH 12/19] python310Packages.asn1tools: init at 0.163.0 --- .../python-modules/asn1tools/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/asn1tools/default.nix diff --git a/pkgs/development/python-modules/asn1tools/default.nix b/pkgs/development/python-modules/asn1tools/default.nix new file mode 100644 index 000000000000..bba82425cc05 --- /dev/null +++ b/pkgs/development/python-modules/asn1tools/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, bitstruct +, diskcache +, prompt-toolkit +, pyparsing +, python +}: + +buildPythonPackage rec { + pname = "asn1tools"; + version = "0.163.0"; + + src = fetchFromGitHub { + owner = "eerimoq"; + repo = "asn1tools"; + rev = "v${version}"; + sha256 = "sha256-sbwwbwkhlZvCb2emuw1FTBj5pnv9SOtHpAcYPSQqIvM="; + }; + + propagatedBuildInputs = [ + bitstruct + diskcache + prompt-toolkit + pyparsing + ]; + + checkPhase = '' + ${python.interpreter} setup.py test + ''; + + pythonImportsCheck = [ "asn1tools" ]; + + meta = with lib; { + description = "ASN.1 parsing, encoding and decoding"; + homepage = "https://github.com/eerimoq/asn1tools"; + license = licenses.mit; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b5103dbcc9c0..6f3e96d3519a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -675,6 +675,8 @@ in { asn1crypto = callPackage ../development/python-modules/asn1crypto { }; + asn1tools = callPackage ../development/python-modules/asn1tools { }; + aspell-python = callPackage ../development/python-modules/aspell-python { }; aspy-refactor-imports = callPackage ../development/python-modules/aspy-refactor-imports { }; From 5f04e659720471f31e1908073f4ffccaec98e275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 04:52:48 +0200 Subject: [PATCH 13/19] python310Packages.autobahn: 22.4.2 -> 22.5.1 --- .../python-modules/autobahn/default.nix | 43 ++++++++----------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/pkgs/development/python-modules/autobahn/default.nix b/pkgs/development/python-modules/autobahn/default.nix index 83276252eee3..10925ebac25e 100644 --- a/pkgs/development/python-modules/autobahn/default.nix +++ b/pkgs/development/python-modules/autobahn/default.nix @@ -1,6 +1,5 @@ { lib , buildPythonPackage -, fetchpatch , fetchPypi , attrs , argon2-cffi @@ -10,7 +9,8 @@ , click , cryptography , ecdsa - # , eth-abi +, eth-abi +, eth-account , flatbuffers , jinja2 , hkdf @@ -19,14 +19,14 @@ , mock , msgpack , passlib - # , py-ecc - # , py-eth-sig-utils +, py-ecc +, py-eth-sig-utils , py-multihash , py-ubjson , pynacl , pygobject3 , pyopenssl -, pyqrcode +, qrcode , pytest-asyncio , python-snappy , pytestCheckHook @@ -48,27 +48,20 @@ buildPythonPackage rec { pname = "autobahn"; - version = "22.4.2"; + version = "22.5.1"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-V7es8ijVDYPPMnNyuInioWioaSdbJuF5F+0LTPTYI6Y="; + sha256 = "sha256-NKpVabC0QZ+MJ3eSxgDcJRjEkwkox04iee+LiNi4o+o="; }; - patches = [ - # fix txaio compatibility - (fetchpatch { - url = "https://github.com/crossbario/autobahn-python/commit/2e2ee5f9775ed312db699f5c55fc0488311735a5.patch"; - excludes = [ - "setup.py" - "tox.ini" - ]; - sha256 = "sha256-LQSusXZwDpxyQl4tphZovaYceg/JVG0SyoA9FUQlVWU="; - }) - ]; + postPatch = '' + substituteInPlace setup.py \ + --replace "pytest>=2.8.6,<3.3.0" "pytest" + ''; propagatedBuildInputs = [ cryptography @@ -81,13 +74,11 @@ buildPythonPackage rec { mock pytest-asyncio pytestCheckHook + # FIXME: remove the following dependencies when web3 gets added + eth-account ] ++ passthru.optional-dependencies.scram - ++ passthru.optional-dependencies.serialization; - - postPatch = '' - substituteInPlace setup.py \ - --replace "pytest>=2.8.6,<3.3.0" "pytest" - ''; + ++ passthru.optional-dependencies.serialization + ++ passthru.optional-dependencies.xbr; preCheck = '' # Run asyncio tests (requires twisted) @@ -106,13 +97,13 @@ buildPythonPackage rec { all = accelerate ++ compress ++ encryption ++ nvx ++ serialization ++ scram ++ twisted ++ ui ++ xbr; accelerate = [ /* wsaccel */ ]; compress = [ python-snappy ]; - encryption = [ pynacl pyopenssl pyqrcode /* pytrie */ service-identity ]; + encryption = [ pynacl pyopenssl qrcode /* pytrie */ service-identity ]; nvx = [ cffi ]; scram = [ argon2-cffi cffi passlib ]; serialization = [ cbor2 flatbuffers msgpack ujson py-ubjson ]; twisted = [ attrs args.twisted zope_interface ]; ui = [ pygobject3 ]; - xbr = [ base58 cbor2 click ecdsa /* eth-abi */ jinja2 hkdf mnemonic /* py-ecc py-eth-sig-utils */ py-multihash rlp spake2 twisted /* web3 xbr */ yapf /* zlmdb */ ]; + xbr = [ base58 cbor2 click ecdsa eth-abi jinja2 hkdf mnemonic py-ecc py-eth-sig-utils py-multihash rlp spake2 twisted /* web3 xbr */ yapf /* zlmdb */ ]; }; meta = with lib; { From 4f8ac15c523a878196c9f00d9a9b3dd1fbda9e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 05:00:03 +0200 Subject: [PATCH 14/19] python310Packages.coincurve: init at 17.0.0 --- .../python-modules/coincurve/default.nix | 72 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 ++ 2 files changed, 76 insertions(+) create mode 100644 pkgs/development/python-modules/coincurve/default.nix diff --git a/pkgs/development/python-modules/coincurve/default.nix b/pkgs/development/python-modules/coincurve/default.nix new file mode 100644 index 000000000000..5d259f250b5f --- /dev/null +++ b/pkgs/development/python-modules/coincurve/default.nix @@ -0,0 +1,72 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, asn1crypto +, autoconf +, automake +, cffi +, libtool +, pkg-config +, pytestCheckHook +, python +, pythonOlder +, secp256k1 +}: + +buildPythonPackage rec { + pname = "coincurve"; + version = "17.0.0"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "ofek"; + repo = "coincurve"; + rev = "v${version}"; + sha256 = "sha256-7H4/TDxteuMTrj1PdfpA5rc7CegJAOjqn1PteImfGiQ="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace ", 'requests'" "" + + # don't try to load .dll files + rm coincurve/_windows_libsecp256k1.py + cp -r --no-preserve=mode ${secp256k1.src} libsecp256k1 + patchShebangs secp256k1/autogen.sh + ''; + + nativeBuildInputs = [ + autoconf + automake + libtool + pkg-config + ]; + + propagatedBuildInputs = [ + asn1crypto + cffi + ]; + + preCheck = '' + # https://github.com/ofek/coincurve/blob/master/tox.ini#L20-L22= + rm -rf coincurve + + # don't run benchmark tests + rm tests/test_bench.py + ''; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "coincurve" + ]; + + meta = with lib; { + description = "Cross-platform bindings for libsecp256k1"; + homepage = "https://github.com/ofek/coincurve"; + license = with licenses; [ asl20 mit ]; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6f3e96d3519a..8fb341640d01 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1549,6 +1549,10 @@ in { censys = callPackage ../development/python-modules/censys { }; + coincurve = callPackage ../development/python-modules/coincurve { + inherit (pkgs) secp256k1; + }; + connect-box = callPackage ../development/python-modules/connect_box { }; connection-pool = callPackage ../development/python-modules/connection-pool { }; From d515058727c54474ae7b1ea79036b003d9b79615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 06:20:54 +0200 Subject: [PATCH 15/19] python310Packages.eth-rlp: init at 0.3.0 --- .../python-modules/eth-rlp/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/eth-rlp/default.nix diff --git a/pkgs/development/python-modules/eth-rlp/default.nix b/pkgs/development/python-modules/eth-rlp/default.nix new file mode 100644 index 000000000000..72cd3c1e8408 --- /dev/null +++ b/pkgs/development/python-modules/eth-rlp/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, eth-hash +, eth-utils +, hexbytes +, pytestCheckHook +, pythonOlder +, rlp +}: + +buildPythonPackage rec { + pname = "eth-rlp"; + version = "0.3.0"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "eth-rlp"; + rev = "v${version}"; + sha256 = "sha256-wfmRjHFu6H3J6hNin8ZA2454xXrLgcUdeR8iGXFomRE="; + }; + + propagatedBuildInputs = [ + hexbytes + eth-utils + rlp + ]; + + checkInputs = [ + pytestCheckHook + ] ++ eth-hash.optional-dependencies.pycryptodome; + + pythonImportsCheck = [ "eth_rlp" ]; + + meta = with lib; { + description = "RLP definitions for common Ethereum objects"; + homepage = "https://github.com/ethereum/eth-rlp"; + license = licenses.mit; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8fb341640d01..157521f3c3a1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2819,6 +2819,8 @@ in { eth-keys = callPackage ../development/python-modules/eth-keys { }; + eth-rlp = callPackage ../development/python-modules/eth-rlp { }; + eth-typing = callPackage ../development/python-modules/eth-typing { }; eth-utils = callPackage ../development/python-modules/eth-utils { }; From 4c391ff1dfd9b61823b061fa37345b30ee4983d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 06:24:33 +0200 Subject: [PATCH 16/19] python310Packages.hexbytes: init at 0.2.2 --- .../python-modules/hexbytes/default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/hexbytes/default.nix diff --git a/pkgs/development/python-modules/hexbytes/default.nix b/pkgs/development/python-modules/hexbytes/default.nix new file mode 100644 index 000000000000..79fc42ae3d02 --- /dev/null +++ b/pkgs/development/python-modules/hexbytes/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, eth-utils +, hypothesis +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "hexbytes"; + version = "0.2.2"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "hexbytes"; + rev = "v${version}"; + sha256 = "sha256-SZscM6ze9yY+iRDx/5F4XbrLXIbp6QkFnzxN7zvP9CQ="; + }; + + checkInputs = [ + eth-utils + hypothesis + pytestCheckHook + ]; + + pythonImportsCheck = [ "hexbytes" ]; + + meta = with lib; { + description = "`bytes` subclass that decodes hex, with a readable console output"; + homepage = "https://github.com/ethereum/hexbytes"; + license = licenses.mit; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 157521f3c3a1..5acd68ce33d2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3925,6 +3925,8 @@ in { heudiconv = callPackage ../development/python-modules/heudiconv { }; + hexbytes = callPackage ../development/python-modules/hexbytes { }; + hg-commitsigs = callPackage ../development/python-modules/hg-commitsigs { }; hg-evolve = callPackage ../development/python-modules/hg-evolve { }; From fb38e46dc19e1d36e29ab33c1646d60b75cbf338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 06:25:12 +0200 Subject: [PATCH 17/19] python310Packages.rlp: adopt, cleanup --- .../python-modules/rlp/default.nix | 47 ++++++++++++------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/rlp/default.nix b/pkgs/development/python-modules/rlp/default.nix index ec735c057abf..e0736cdf0506 100644 --- a/pkgs/development/python-modules/rlp/default.nix +++ b/pkgs/development/python-modules/rlp/default.nix @@ -1,31 +1,42 @@ -{ lib, fetchPypi, buildPythonPackage, pytest, hypothesis, eth-utils }: +{ lib +, fetchFromGitHub +, buildPythonPackage +, eth-utils +, hypothesis +, pytestCheckHook +}: buildPythonPackage rec { pname = "rlp"; version = "3.0.0"; - src = fetchPypi { - inherit pname version; - sha256 = "63b0465d2948cd9f01de449d7adfb92d207c1aef3982f20310f8009be4a507e8"; + src = fetchFromGitHub { + owner = "ethereum"; + repo = "pyrlp"; + rev = "v${version}"; + sha256 = "sha256-GRCq4FU38e08fREg5fweig5Y60jLT2k3Yj1Jk8OA6XY="; }; - checkInputs = [ pytest hypothesis ]; - propagatedBuildInputs = [ eth-utils ]; - - # setuptools-markdown uses pypandoc which is broken at the moment - preConfigure = '' - substituteInPlace setup.py --replace \'setuptools-markdown\' "" - substituteInPlace setup.py --replace "long_description_markdown_filename='README.md'," "" + postPatch = '' + substituteInPlace setup.py \ + --replace "'setuptools-markdown'" "" ''; - checkPhase = '' - pytest . - ''; + propagatedBuildInputs = [ + eth-utils + ]; - meta = { - description = "A package for encoding and decoding data in and from Recursive Length Prefix notation"; + checkInputs = [ + hypothesis + pytestCheckHook + ]; + + pythonImportsCheck = [ "rlp" ]; + + meta = with lib; { + description = "RLP serialization library"; homepage = "https://github.com/ethereum/pyrlp"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ gebner ]; + license = licenses.mit; + maintainers = with maintainers; [ SuperSandro2000 ]; }; } From 8437545f81249b032b6a4fd887dbd8feeada80f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 07:21:23 +0200 Subject: [PATCH 18/19] python310Packages.buildbot: remove linters --- pkgs/development/python-modules/buildbot/default.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/buildbot/default.nix b/pkgs/development/python-modules/buildbot/default.nix index a49c7d6c2f2d..4e9ccaf23701 100644 --- a/pkgs/development/python-modules/buildbot/default.nix +++ b/pkgs/development/python-modules/buildbot/default.nix @@ -1,7 +1,7 @@ { stdenv, lib, buildPythonPackage, fetchpatch, fetchPypi, makeWrapper, isPy3k , python, twisted, jinja2, msgpack, zope_interface, sqlalchemy, alembic , python-dateutil, txaio, autobahn, pyjwt, pyyaml, treq, txrequests, pypugjs -, boto3, moto, mock, lz4, setuptoolsTrial, isort, pylint, flake8 +, boto3, moto, mock, lz4, setuptoolsTrial , buildbot-worker, buildbot-pkg, buildbot-plugins, parameterized, git, openssh , glibcLocales , nixosTests @@ -65,9 +65,6 @@ let mock lz4 setuptoolsTrial - isort - pylint - flake8 buildbot-worker buildbot-pkg buildbot-plugins.www From 3ca93302d496e6c1487e7895cc55001b034b999f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 07:21:45 +0200 Subject: [PATCH 19/19] tahoe-lafs: update meta.platforms, disable outdated test --- pkgs/tools/networking/p2p/tahoe-lafs/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/p2p/tahoe-lafs/default.nix b/pkgs/tools/networking/p2p/tahoe-lafs/default.nix index c6107086fde5..f50920186dfe 100644 --- a/pkgs/tools/networking/p2p/tahoe-lafs/default.nix +++ b/pkgs/tools/networking/p2p/tahoe-lafs/default.nix @@ -31,6 +31,9 @@ python3Packages.buildPythonApplication rec { sed -i 's/"zope.interface.*"/"zope.interface"/' src/allmydata/_auto_deps.py sed -i 's/"pycrypto.*"/"pycrypto"/' src/allmydata/_auto_deps.py + + # incompatible with latest autobahn + rm src/allmydata/test/web/test_logs.py ''; # Remove broken and expensive tests. @@ -95,6 +98,6 @@ python3Packages.buildPythonApplication rec { homepage = "https://tahoe-lafs.org/"; license = [ licenses.gpl2Plus /* or */ "TGPPLv1+" ]; maintainers = with lib.maintainers; [ MostAwesomeDude ]; - platforms = platforms.gnu ++ platforms.linux; + platforms = platforms.linux; }; }