Merge pull request #290981 from dotlambda/autobahn-fix

python311Packages.autobahn: fix tests
This commit is contained in:
Martin Weinelt 2024-02-24 01:52:36 +01:00 committed by GitHub
commit 5faa932cc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 84 additions and 22 deletions

View file

@ -27,7 +27,7 @@
, pygobject3 , pygobject3
, pyopenssl , pyopenssl
, qrcode , qrcode
, pytest-asyncio , pytest-asyncio_0_21
, python-snappy , python-snappy
, pytestCheckHook , pytestCheckHook
, pythonOlder , pythonOlder
@ -72,7 +72,7 @@ buildPythonPackage rec {
nativeCheckInputs = [ nativeCheckInputs = [
mock mock
pytest-asyncio pytest-asyncio_0_21
pytestCheckHook pytestCheckHook
] ++ passthru.optional-dependencies.scram ] ++ passthru.optional-dependencies.scram
++ passthru.optional-dependencies.serialization ++ passthru.optional-dependencies.serialization

View file

@ -3,12 +3,13 @@
, buildPythonPackage , buildPythonPackage
, pythonOlder , pythonOlder
, pytestCheckHook , pytestCheckHook
, setuptools
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "eth-typing"; pname = "eth-typing";
version = "3.2.0"; version = "4.0.0";
format = "setuptools"; pyproject = true;
disabled = pythonOlder "3.6"; disabled = pythonOlder "3.6";
@ -16,9 +17,13 @@ buildPythonPackage rec {
owner = "ethereum"; owner = "ethereum";
repo = "eth-typing"; repo = "eth-typing";
rev = "refs/tags/v${version}"; rev = "refs/tags/v${version}";
hash = "sha256-klN38pIQ9ZOFV7dzXNvylPGfifR8pXRLTJ3VE579AY0="; hash = "sha256-JT/2bCPYFSRNt3V7QnHSAJR7HrZ1JpRKdU7gQpoYIn0=";
}; };
nativeBuildInputs = [
setuptools
];
nativeCheckInputs = [ nativeCheckInputs = [
pytestCheckHook pytestCheckHook
]; ];

View file

@ -8,22 +8,27 @@
, isPyPy , isPyPy
, pytestCheckHook , pytestCheckHook
, pythonOlder , pythonOlder
, setuptools
, toolz , toolz
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "eth-utils"; pname = "eth-utils";
version = "2.1.1"; version = "4.0.0";
format = "setuptools"; pyproject = true;
disabled = pythonOlder "3.6"; disabled = pythonOlder "3.6";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ethereum"; owner = "ethereum";
repo = pname; repo = "eth-utils";
rev = "v${version}"; rev = "v${version}";
hash = "sha256-Ogp4o99smw5qVwDec6zd/xVqqKMyNk41iBfRNzrwuvE="; hash = "sha256-k2pHM1eKPzoGxZlU6yT7bZMv4CCWGaZaSnFHSbT76Zo=";
}; };
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [ propagatedBuildInputs = [
eth-hash eth-hash
eth-typing eth-typing
@ -44,6 +49,7 @@ buildPythonPackage rec {
pythonImportsCheck = [ "eth_utils" ]; pythonImportsCheck = [ "eth_utils" ];
meta = { 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"; description = "Common utility functions for codebases which interact with ethereum";
homepage = "https://github.com/ethereum/eth-utils"; homepage = "https://github.com/ethereum/eth-utils";
license = lib.licenses.mit; license = lib.licenses.mit;

View file

@ -4,38 +4,55 @@
, cached-property , cached-property
, eth-typing , eth-typing
, eth-utils , eth-utils
, mypy-extensions
, pytestCheckHook , pytestCheckHook
, pythonAtLeast
, pythonOlder , pythonOlder
, setuptools
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "py-ecc"; pname = "py-ecc";
version = "6.0.0"; version = "7.0.0";
format = "setuptools"; pyproject = true;
disabled = pythonOlder "3.6"; disabled = pythonOlder "3.8";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ethereum"; owner = "ethereum";
repo = "py_ecc"; repo = "py_ecc";
rev = "v${version}"; rev = "v${version}";
hash = "sha256-638otYA3e/Ld4mcM69yrqHQnGoK/Sfl/UA9FWnjgO/U="; hash = "sha256-DKe+bI1GEzXg4Y4n5OA1/hWYz9L3X1AvaOFPEnCaAfs=";
}; };
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [ propagatedBuildInputs = [
cached-property cached-property
eth-typing eth-typing
eth-utils eth-utils
mypy-extensions
]; ];
nativeCheckInputs = [ nativeCheckInputs = [
pytestCheckHook 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" ]; pythonImportsCheck = [ "py_ecc" ];
meta = with lib; { 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"; description = "ECC pairing and bn_128 and bls12_381 curve operations";
homepage = "https://github.com/ethereum/py_ecc"; homepage = "https://github.com/ethereum/py_ecc";
license = licenses.mit; license = licenses.mit;

View file

@ -1,26 +1,50 @@
{ lib, buildPythonPackage, fetchPypi, hkdf, pytest }: { lib
, buildPythonPackage
, fetchPypi
, fetchpatch2
, setuptools
, hkdf
, pytestCheckHook
}:
buildPythonPackage rec { buildPythonPackage rec {
pname = "spake2"; pname = "spake2";
version = "0.8"; version = "0.8";
format = "setuptools"; pyproject = true;
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
sha256 = "c17a614b29ee4126206e22181f70a406c618d3c6c62ca6d6779bce95e9c926f4"; 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 = '' propagatedBuildInputs = [
py.test $out hkdf
''; ];
pythonImportsCheck = [ "spake2" ];
nativeCheckInputs = [
pytestCheckHook
];
meta = with lib; { meta = with lib; {
changelog = "https://github.com/warner/python-spake2/blob/v${version}/NEWS";
description = "SPAKE2 password-authenticated key exchange library"; description = "SPAKE2 password-authenticated key exchange library";
homepage = "https://github.com/warner/python-spake2"; homepage = "https://github.com/warner/python-spake2";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
}; };
} }

View file

@ -11614,6 +11614,16 @@ self: super: with self; {
pytest-asyncio = callPackage ../development/python-modules/pytest-asyncio { }; 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-bdd = callPackage ../development/python-modules/pytest-bdd { };
pytest-benchmark = callPackage ../development/python-modules/pytest-benchmark { }; pytest-benchmark = callPackage ../development/python-modules/pytest-benchmark { };