From 9ecc4fccb52a86388bc0317369f530bd11a8f234 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 11 Jan 2021 12:13:11 +0100 Subject: [PATCH 1/3] python3Packages.aresponses: 2.0.0 -> 2.1.0 --- pkgs/development/python-modules/aresponses/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/aresponses/default.nix b/pkgs/development/python-modules/aresponses/default.nix index 56093192d6c..7906a10cbe7 100644 --- a/pkgs/development/python-modules/aresponses/default.nix +++ b/pkgs/development/python-modules/aresponses/default.nix @@ -11,13 +11,13 @@ buildPythonPackage rec { pname = "aresponses"; - version = "2.0.0"; + version = "2.1.0"; disabled = !isPy3k; src = fetchPypi { inherit pname version; - sha256 = "58693a6b715edfa830a20903ee1d1b2a791251923f311b3bebf113e8ff07bb35"; + sha256 = "1jn7x7ldqsz5cd190jqjil0kqyimd1d0yxfzzp41ky0p72lvd68a"; }; propagatedBuildInputs = [ From 66a81b872f6866bfcb5b208c46db11609d095408 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 11 Jan 2021 12:16:08 +0100 Subject: [PATCH 2/3] python3Packages.aresponses: use GitHub as source and enable tests --- .../python-modules/aresponses/default.nix | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/aresponses/default.nix b/pkgs/development/python-modules/aresponses/default.nix index 7906a10cbe7..2407adefd5c 100644 --- a/pkgs/development/python-modules/aresponses/default.nix +++ b/pkgs/development/python-modules/aresponses/default.nix @@ -1,12 +1,11 @@ { lib -, buildPythonPackage -, fetchPypi -# propagatedBuildInputs , aiohttp -# buildInputs +, buildPythonPackage +, fetchFromGitHub +, isPy3k , pytest , pytest-asyncio -, isPy3k +, pytestCheckHook }: buildPythonPackage rec { @@ -15,9 +14,11 @@ buildPythonPackage rec { disabled = !isPy3k; - src = fetchPypi { - inherit pname version; - sha256 = "1jn7x7ldqsz5cd190jqjil0kqyimd1d0yxfzzp41ky0p72lvd68a"; + src = fetchFromGitHub { + owner = "CircleUp"; + repo = pname; + rev = version; + sha256 = "0dc1y4s6kpmr0ar63kkyghvisgbmb8qq5wglmjclrpzd5180mjcl"; }; propagatedBuildInputs = [ @@ -29,13 +30,24 @@ buildPythonPackage rec { pytest-asyncio ]; - # tests only distributed via git repository, not pypi - doCheck = false; + checkInputs = [ + aiohttp + pytestCheckHook + pytest-asyncio + ]; + + # Disable tests which requires network access + disabledTests = [ + "test_foo" + "test_passthrough" + ]; + + pythonImportsCheck = [ "aresponses" ]; meta = with lib; { description = "Asyncio testing server"; homepage = "https://github.com/circleup/aresponses"; license = licenses.mit; - maintainers = [ maintainers.makefu ]; + maintainers = with maintainers; [ makefu ]; }; } From ac8a17dd5628c5350e5c6f9c1c6df0adf2583d08 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 15 Jan 2021 08:10:35 +0100 Subject: [PATCH 3/3] python3Packages.pyipp: switch to pytestCheckHook and exclude tests --- .../python-modules/pyipp/default.nix | 35 ++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/pyipp/default.nix b/pkgs/development/python-modules/pyipp/default.nix index 98bb6360ce5..ed5a5f4576a 100644 --- a/pkgs/development/python-modules/pyipp/default.nix +++ b/pkgs/development/python-modules/pyipp/default.nix @@ -1,11 +1,18 @@ -{ lib, buildPythonPackage, fetchFromGitHub, isPy27 -, aiohttp, deepmerge, yarl -, aresponses, pytest, pytest-asyncio, pytestcov }: +{ lib +, aiohttp +, aresponses +, buildPythonPackage +, deepmerge +, fetchFromGitHub +, pytest-asyncio +, pytestCheckHook +, pytestcov +, yarl +}: buildPythonPackage rec { pname = "pyipp"; version = "0.11.0"; - disabled = isPy27; src = fetchFromGitHub { owner = "ctalkington"; @@ -22,14 +29,26 @@ buildPythonPackage rec { checkInputs = [ aresponses - pytest pytest-asyncio pytestcov + pytestCheckHook ]; - checkPhase = '' - pytest -q . - ''; + # Some tests are failing due to encoding issues + # https://github.com/ctalkington/python-ipp/issues/121 + disabledTests = [ + "test_internal_session" + "test_request_port" + "est_http_error426" + "test_unexpected_response" + "test_printer" + "test_raw" + "test_ipp_request" + "test_request_tls" + "test_ipp_error_0x0503" + ]; + + pythonImportsCheck = [ "pyipp" ]; meta = with lib; { description = "Asynchronous Python client for Internet Printing Protocol (IPP)";