From 0d688b843dc6b4d189f26facba0200390a972e8f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 23 May 2021 21:55:33 +0200 Subject: [PATCH 1/8] python3Packages.systembridge: 1.1.1 -> 1.2.4 --- pkgs/development/python-modules/systembridge/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/systembridge/default.nix b/pkgs/development/python-modules/systembridge/default.nix index 94d41b7b673b..6174e507d2a6 100644 --- a/pkgs/development/python-modules/systembridge/default.nix +++ b/pkgs/development/python-modules/systembridge/default.nix @@ -6,13 +6,13 @@ buildPythonPackage rec { pname = "systembridge"; - version = "1.1.1"; + version = "1.2.4"; src = fetchFromGitHub { owner = "timmo001"; repo = "system-bridge-connector-py"; rev = "v${version}"; - sha256 = "0vyfi7nyzkzsgg84n5wh4hzwvx6fybgqdzbabnsmvszb9sm1vlb2"; + sha256 = "sha256-dZOtvJXBXMKC+VOyQRMyaWAXg8lHjLcM2Zz9P0/ILT8="; }; propagatedBuildInputs = [ From efe210cec8e21fd7e29cd1801552b6458549eca0 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 8 Jun 2021 10:52:57 +0200 Subject: [PATCH 2/8] python3Packages.pytest-sanic: allow later websockets releases --- .../python-modules/pytest-sanic/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pytest-sanic/default.nix b/pkgs/development/python-modules/pytest-sanic/default.nix index 81e189c22c57..3cea788643ca 100644 --- a/pkgs/development/python-modules/pytest-sanic/default.nix +++ b/pkgs/development/python-modules/pytest-sanic/default.nix @@ -21,7 +21,9 @@ buildPythonPackage rec { sha256 = "sha256-OtyulpSHUWERtcIRT5j3YtHciIxFiIFYKqtlEd1NSFw="; }; - buildInputs = [ pytest ]; + buildInputs = [ + pytest + ]; propagatedBuildInputs = [ aiohttp @@ -36,6 +38,12 @@ buildPythonPackage rec { pytestCheckHook ]; + postPatch = '' + # https://github.com/yunstanford/pytest-sanic/issues/55 + substituteInPlace setup.py \ + --replace "websockets>=8.1,<9.0" "websockets>=9.1,<10.0" + ''; + disabledTests = [ # https://github.com/yunstanford/pytest-sanic/issues/51 "test_fixture_sanic_client_get" From 515b0b158cfde071b6b9f89964cf3510043f9404 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 8 Jun 2021 10:53:19 +0200 Subject: [PATCH 3/8] python3Packages.sanic-testing: 0.3.1 -> 0.4.0 --- .../python-modules/sanic-testing/default.nix | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/sanic-testing/default.nix b/pkgs/development/python-modules/sanic-testing/default.nix index e5194e36bd23..71af4a0a1170 100644 --- a/pkgs/development/python-modules/sanic-testing/default.nix +++ b/pkgs/development/python-modules/sanic-testing/default.nix @@ -2,7 +2,6 @@ , buildPythonPackage , fetchFromGitHub , pytestCheckHook -, httpcore , httpx , pytest-asyncio , sanic @@ -11,22 +10,31 @@ buildPythonPackage rec { pname = "sanic-testing"; - version = "0.3.1"; + version = "0.4.0"; src = fetchFromGitHub { owner = "sanic-org"; repo = "sanic-testing"; rev = "v${version}"; - hash = "sha256-hBAq+/BKs0a01M89Nb8HaClqxB+W5PTfjVzef/m9SWs="; + sha256 = "0li984imqmqc001iw4m4b6cqik3d9nb4b3yvamvbwkb6hgd94sck"; }; - postPatch = '' - substituteInPlace setup.py \ - --replace 'httpx>=0.16, <0.18' 'httpx' \ - --replace 'httpcore==0.12.*' 'httpcore' - ''; + propagatedBuildInputs = [ + httpx + sanic + websockets + ]; - propagatedBuildInputs = [ httpx sanic websockets httpcore ]; + checkInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + postPatch = '' + # https://github.com/sanic-org/sanic-testing/issues/19 + substituteInPlace setup.py \ + --replace '"websockets==8.1",' '"websockets>=9.1",' + ''; # `sanic` is explicitly set to null when building `sanic` itself # to prevent infinite recursion. In that case we skip running @@ -34,7 +42,6 @@ buildPythonPackage rec { doCheck = sanic != null; dontUsePythonImportsCheck = sanic == null; - checkInputs = [ pytestCheckHook pytest-asyncio ]; pythonImportsCheck = [ "sanic_testing" ]; meta = with lib; { From 88a9705f7d383a32ec1dcecccb12d1d1e3e2534d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 8 Jun 2021 11:32:10 +0200 Subject: [PATCH 4/8] python3Packages.amqtt: 0.10.0-alpha.3 -> 0.10.0-alpha.4 --- pkgs/development/python-modules/amqtt/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/amqtt/default.nix b/pkgs/development/python-modules/amqtt/default.nix index 8ab0e7a7c0cc..d0cc2bd5da56 100644 --- a/pkgs/development/python-modules/amqtt/default.nix +++ b/pkgs/development/python-modules/amqtt/default.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { pname = "amqtt"; - version = "0.10.0-alpha.3"; + version = "0.10.0-alpha.4"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -23,7 +23,7 @@ buildPythonPackage rec { owner = "Yakifo"; repo = pname; rev = "v${version}"; - sha256 = "0wz85ykjgi2174qcdgpakmc4m0p96v62az7pvc9hyallq1v1k4n6"; + sha256 = "1v5hlcciyicnhwk1xslh3kxyjqaw526fb05pvhjpp3zqrmbxya4d"; }; nativeBuildInputs = [ poetry-core ]; From 35b79dcf3689e192a452d1c3ff3e5c00e0cf9f31 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 8 Jun 2021 13:49:25 +0200 Subject: [PATCH 5/8] python3Packages.slack-sdk: 3.5.0 -> 3.6.0 --- pkgs/development/python-modules/slack-sdk/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/slack-sdk/default.nix b/pkgs/development/python-modules/slack-sdk/default.nix index 9044ce19b5d8..d04fd24f2e97 100644 --- a/pkgs/development/python-modules/slack-sdk/default.nix +++ b/pkgs/development/python-modules/slack-sdk/default.nix @@ -21,14 +21,14 @@ buildPythonPackage rec { pname = "slack-sdk"; - version = "3.5.0"; + version = "3.6.0"; disabled = !isPy3k; src = fetchFromGitHub { owner = "slackapi"; repo = "python-slack-sdk"; rev = "v${version}"; - sha256 = "sha256-5ZBaF/6p/eOWjAmo+IlF9zCb9xBr2bP6suPZblRogUg="; + sha256 = "sha256-OSRz8yH1yrWhN2a6ir4nxsPahwg8oHfVlJ020Swlb+Q="; }; propagatedBuildInputs = [ From 4558f8b5476c61b11cfce659ba69cb06c5602b06 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 8 Jun 2021 22:53:02 +0200 Subject: [PATCH 6/8] python3Packages.websockets: 8.1 -> 9.1 --- .../python-modules/websockets/default.nix | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/websockets/default.nix b/pkgs/development/python-modules/websockets/default.nix index eeb12bd5b75b..51df6c70235d 100644 --- a/pkgs/development/python-modules/websockets/default.nix +++ b/pkgs/development/python-modules/websockets/default.nix @@ -1,37 +1,45 @@ { lib -, fetchFromGitHub , buildPythonPackage +, fetchFromGitHub +, python , pythonOlder -, pytest , stdenv }: buildPythonPackage rec { pname = "websockets"; - version = "8.1"; + version = "9.1"; + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "aaugustin"; repo = pname; rev = version; - sha256 = "05jbqcbjg50ydwl0fijhdlqcq7fl6v99kjva66kmmzzza7vwa872"; + sha256 = "sha256-7Y12IUG+ulD4+CTRlY+NE6qYZyI9gCPDydwpt+uyYZk="; }; - disabled = pythonOlder "3.3"; - # Tests fail on Darwin with `OSError: AF_UNIX path too long` doCheck = !stdenv.isDarwin; # Disable all tests that need to terminate within a predetermined amount of - # time. This is nondeterministic. + # time. This is nondeterministic. patchPhase = '' sed -i 's/with self.assertCompletesWithin.*:/if True:/' \ - tests/test_protocol.py + tests/legacy/test_protocol.py ''; + checkPhase = '' + runHook preCheck + ${python.interpreter} -m unittest discover + runHook postCheck + ''; + + pythonImportsCheck = [ "websockets" ]; + meta = with lib; { - description = "WebSocket implementation in Python 3"; - homepage = "https://github.com/aaugustin/websockets"; + description = "WebSocket implementation in Python"; + homepage = "https://websockets.readthedocs.io/"; license = licenses.bsd3; + maintainers = with maintainers; [ fab ]; }; } From 79d4db358a99aa5a0977762f18600c6d8fc113a1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 8 Jun 2021 22:58:07 +0200 Subject: [PATCH 7/8] python3Packages.sanic: allow later websockets releases --- .../python-modules/sanic/default.nix | 71 ++++++++++++++----- 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/sanic/default.nix b/pkgs/development/python-modules/sanic/default.nix index 5f610f6feab0..cc7be4c93dc6 100644 --- a/pkgs/development/python-modules/sanic/default.nix +++ b/pkgs/development/python-modules/sanic/default.nix @@ -1,24 +1,52 @@ -{ lib, buildPythonPackage, fetchPypi, doCheck ? true -, aiofiles, httptools, multidict, sanic-routing, ujson, uvloop, websockets -, pytestCheckHook, beautifulsoup4, gunicorn, uvicorn, sanic-testing -, pytest-benchmark, pytest-sanic, pytest-sugar, pytestcov +{ lib +, aiofiles +, beautifulsoup4 +, buildPythonPackage +, doCheck ? true +, fetchFromGitHub +, fetchpatch +, gunicorn +, httptools +, multidict +, pytest-asyncio +, pytest-benchmark +, pytest-sanic +, pytest-sugar +, pytestCheckHook +, sanic-routing +, sanic-testing +, ujson +, uvicorn +, uvloop +, websockets }: buildPythonPackage rec { pname = "sanic"; version = "21.3.4"; - src = fetchPypi { - inherit pname version; - sha256 = "1cbd12b9138b3ca69656286b0be91fff02b826e8cb72dd76a2ca8c5eb1288d8e"; + src = fetchFromGitHub { + owner = "sanic-org"; + repo = pname; + rev = "v${version}"; + sha256 = "0vldlic8gqcf56fqb31igycqf11syd9csk66v34w6dim54lcny2b"; }; + patches = [ + # Allow later websockets release, https://github.com/sanic-org/sanic/pull/2154 + (fetchpatch { + name = "later-websockets.patch"; + url = "https://github.com/sanic-org/sanic/commit/5fb820b5c1ce395e86a1ee11996790c65ec7bc65.patch"; + sha256 = "1glvq23pf1sxqjnrz0w8rr7nsnyz82k1479b3rm8szfkjg9q5d1w"; + }) + ]; + postPatch = '' # Loosen dependency requirements. substituteInPlace setup.py \ --replace '"pytest==5.2.1"' '"pytest"' \ --replace '"gunicorn==20.0.4"' '"gunicorn"' \ - --replace '"pytest-sanic",' "" + --replace '"pytest-sanic",' "" \ # Patch a request headers test to allow brotli encoding # (we build httpx with brotli support, upstream doesn't). substituteInPlace tests/test_headers.py \ @@ -26,25 +54,36 @@ buildPythonPackage rec { ''; propagatedBuildInputs = [ - sanic-routing httptools uvloop ujson aiofiles websockets multidict + aiofiles + httptools + multidict + sanic-routing + ujson + uvloop + websockets ]; checkInputs = [ - sanic-testing gunicorn pytestcov beautifulsoup4 pytest-sanic pytest-sugar - pytest-benchmark pytestCheckHook uvicorn + beautifulsoup4 + gunicorn + pytest-asyncio + pytest-benchmark + pytest-sanic + pytest-sugar + pytestCheckHook + sanic-testing + uvicorn ]; inherit doCheck; disabledTests = [ - # No "examples" directory in pypi distribution - "test_gunicorn" - "test_zero_downtime" - # flaky + # Tests are flaky "test_keep_alive_client_timeout" "test_check_timeouts_request_timeout" "test_check_timeouts_response_timeout" "test_reloader_live" + "test_zero_downtime" ]; __darwinAllowLocalNetworking = true; @@ -52,7 +91,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "sanic" ]; meta = with lib; { - description = "A microframework based on uvloop, httptools, and learnings of flask"; + description = "Web server and web framework"; homepage = "https://github.com/sanic-org/sanic/"; license = licenses.mit; maintainers = with maintainers; [ costrouc AluisioASG ]; From f7827c4a4f5bde40c5167aba98d7057b5d70fb09 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 9 Jun 2021 23:00:09 +0200 Subject: [PATCH 8/8] chia: allow later websockets releases --- pkgs/applications/blockchains/chia/default.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/blockchains/chia/default.nix b/pkgs/applications/blockchains/chia/default.nix index 22bb3d445ada..7b85a242effa 100644 --- a/pkgs/applications/blockchains/chia/default.nix +++ b/pkgs/applications/blockchains/chia/default.nix @@ -1,4 +1,8 @@ -{ lib, fetchFromGitHub, python3Packages }: +{ lib +, fetchFromGitHub +, fetchpatch +, python3Packages +}: python3Packages.buildPythonApplication rec { pname = "chia"; @@ -14,6 +18,12 @@ python3Packages.buildPythonApplication rec { patches = [ # tweak version requirements to what's available in Nixpkgs ./dependencies.patch + # Allow later websockets release, https://github.com/Chia-Network/chia-blockchain/pull/6304 + (fetchpatch { + name = "later-websockets.patch"; + url = "https://github.com/Chia-Network/chia-blockchain/commit/a188f161bf15a30e8e2efc5eec824e53e2a98a5b.patch"; + sha256 = "1s5qjhd4kmi28z6ni7pc5n09czxvh8qnbwmnqsmms7cpw700g78s"; + }) ]; nativeBuildInputs = [ @@ -47,8 +57,8 @@ python3Packages.buildPythonApplication rec { websockets ]; - checkInputs = [ - python3Packages.pytestCheckHook + checkInputs = with python3Packages; [ + pytestCheckHook ]; disabledTests = [