From 9677aba91e9208dc84490bc460dacd693cf72417 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 16 Mar 2021 20:39:46 +0100 Subject: [PATCH 1/4] python3Packages.txaio: update check part --- .../python-modules/txaio/default.nix | 51 ++++++++++++++----- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/txaio/default.nix b/pkgs/development/python-modules/txaio/default.nix index c2f2c9451bd..fa219a94513 100644 --- a/pkgs/development/python-modules/txaio/default.nix +++ b/pkgs/development/python-modules/txaio/default.nix @@ -1,30 +1,55 @@ -{ lib, buildPythonPackage, fetchPypi, pytest, mock, six, twisted, isPy37, isPy27 }: +{ lib +, buildPythonPackage +, fetchPypi +, mock +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, six +, twisted +, zope_interface +}: buildPythonPackage rec { pname = "txaio"; version = "21.2.1"; - disabled = isPy27; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "7d6f89745680233f1c4db9ddb748df5e88d2a7a37962be174c0fd04c8dba1dc8"; + sha256 = "sha256-fW+JdFaAIz8cTbndt0jfXojSp6N5Yr4XTA/QTI26Hcg="; }; - checkInputs = [ pytest mock ]; + propagatedBuildInputs = [ + six + twisted + zope_interface + ]; - propagatedBuildInputs = [ six twisted ]; + checkInputs = [ + mock + pytest-asyncio + pytestCheckHook + ]; - checkPhase = '' - py.test -k "not test_sdist" - ''; + disabledTests = [ + # No real value + "test_sdist" + # Some tests seems out-dated and require additional data + "test_as_future" + "test_errback" + "test_create_future" + "test_callback" + "test_immediate_result" + "test_cancel" + ]; - # Needs some fixing - doCheck = false; + pythonImportsCheck = [ "txaio" ]; meta = with lib; { - description = "Utilities to support code that runs unmodified on Twisted and asyncio."; - homepage = "https://github.com/crossbario/txaio"; - license = licenses.mit; + description = "Utilities to support code that runs unmodified on Twisted and asyncio"; + homepage = "https://github.com/crossbario/txaio"; + license = licenses.mit; maintainers = with maintainers; [ nand0p ]; }; } From 5396cc05d9a12ee135dbfa35e414b6f654ecfc69 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 17 Apr 2021 21:51:59 +0200 Subject: [PATCH 2/4] python3Packages.py-ubjson: init at 0.16.1 --- .../python-modules/py-ubjson/default.nix | 32 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/development/python-modules/py-ubjson/default.nix diff --git a/pkgs/development/python-modules/py-ubjson/default.nix b/pkgs/development/python-modules/py-ubjson/default.nix new file mode 100644 index 00000000000..4efa2b8b6fd --- /dev/null +++ b/pkgs/development/python-modules/py-ubjson/default.nix @@ -0,0 +1,32 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "py-ubjson"; + version = "0.16.1"; + + src = fetchFromGitHub { + owner = "Iotic-Labs"; + repo = pname; + rev = "v${version}"; + sha256 = "1frn97xfa88zrfmpnvdk1pc03yihlchhph99bhjayvzlfcrhm5v3"; + }; + + checkInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ "test/test.py" ]; + + pythonImportsCheck = [ "ubjson" ]; + + meta = with lib; { + description = "Universal Binary JSON draft-12 serializer for Python"; + homepage = "https://github.com/Iotic-Labs/py-ubjson"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7249173d707..2089342201d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5260,6 +5260,8 @@ in { py-air-control-exporter = callPackage ../development/python-modules/py-air-control-exporter { }; + py-ubjson = callPackage ../development/python-modules/py-ubjson { }; + py2bit = callPackage ../development/python-modules/py2bit { }; py3buddy = toPythonModule (callPackage ../development/python-modules/py3buddy { }); From 5c42f1081bde88d84bbea566b6de130e0234bd26 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 17 Apr 2021 22:14:41 +0200 Subject: [PATCH 3/4] python3Packages.autobahn: update check section --- .../python-modules/autobahn/default.nix | 78 +++++++++++++++---- 1 file changed, 61 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/autobahn/default.nix b/pkgs/development/python-modules/autobahn/default.nix index 19015a5729a..2585cd539d7 100644 --- a/pkgs/development/python-modules/autobahn/default.nix +++ b/pkgs/development/python-modules/autobahn/default.nix @@ -1,34 +1,78 @@ -{ lib, buildPythonPackage, fetchPypi, isPy3k, - six, txaio, twisted, zope_interface, cffi, - mock, pytest, cryptography, pynacl +{ lib +, argon2_cffi +, attrs +, buildPythonPackage +, cbor +, cbor2 +, cffi +, cryptography +, fetchPypi +, flatbuffers +, mock +, msgpack +, passlib +, pynacl +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, twisted +, py-ubjson +, txaio +, ujson +, zope_interface }: + buildPythonPackage rec { pname = "autobahn"; version = "21.3.1"; - disabled = !isPy3k; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "e126c1f583e872fb59e79d36977cfa1f2d0a8a79f90ae31f406faae7664b8e03"; + sha256 = "00wf9dkfgakg80gy62prg650lb8zz9y9fdlxwxcznwp8hgsw29p1"; }; - propagatedBuildInputs = [ six txaio twisted zope_interface cffi cryptography pynacl ]; + propagatedBuildInputs = [ + argon2_cffi + cbor + cbor2 + cffi + cryptography + flatbuffers + msgpack + passlib + py-ubjson + pynacl + twisted + txaio + ujson + zope_interface + ]; - checkInputs = [ mock pytest ]; - checkPhase = '' - runHook preCheck - USE_TWISTED=true py.test $out - runHook postCheck + checkInputs = [ + mock + pytest-asyncio + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "pytest>=2.8.6,<3.3.0" "pytest" ''; - # Tests do no seem to be compatible yet with pytest 5.1 - # https://github.com/crossbario/autobahn-python/issues/1235 - doCheck = false; + preCheck = '' + # Run asyncio tests (requires twisted) + export USE_ASYNCIO=1 + ''; + + pytestFlagsArray = [ "--pyargs autobahn" ]; + + pythonImportsCheck = [ "autobahn" ]; meta = with lib; { - description = "WebSocket and WAMP in Python for Twisted and asyncio."; - homepage = "https://crossbar.io/autobahn"; - license = licenses.mit; + description = "WebSocket and WAMP in Python for Twisted and asyncio"; + homepage = "https://crossbar.io/autobahn"; + license = licenses.mit; maintainers = with maintainers; [ nand0p ]; }; } From 29aaa03932e614724e0d907c39b929eedcbbd0e0 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 21 Apr 2021 08:56:22 +0200 Subject: [PATCH 4/4] pythonPackages.hyperlink: cleanups, add homepage --- pkgs/development/python-modules/hyperlink/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/hyperlink/default.nix b/pkgs/development/python-modules/hyperlink/default.nix index ad56de86782..21927683b18 100644 --- a/pkgs/development/python-modules/hyperlink/default.nix +++ b/pkgs/development/python-modules/hyperlink/default.nix @@ -1,4 +1,10 @@ -{ lib, buildPythonPackage, fetchPypi, isPy27, idna, typing ? null }: +{ lib +, buildPythonPackage +, fetchPypi +, isPy27 +, idna +, typing ? null +}: buildPythonPackage rec { pname = "hyperlink"; @@ -6,7 +12,7 @@ buildPythonPackage rec { src = fetchPypi { inherit pname version; - sha256 = "427af957daa58bc909471c6c40f74c5450fa123dd093fc53efd2e91d2705a56b"; + sha256 = "0sx50lkivsfjxx9zr4yh7l9gll2l9kvl0v0w8w4wk2x5v9bzjyj2"; }; propagatedBuildInputs = [ idna ] @@ -14,6 +20,7 @@ buildPythonPackage rec { meta = with lib; { description = "A featureful, correct URL for Python"; + homepage = "https://github.com/python-hyper/hyperlink"; license = licenses.mit; platforms = platforms.all; maintainers = with maintainers; [ apeschar ];