From d9ddafc4c956b2ed7641cf633c97f517c6e3c5a4 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 25 Feb 2022 13:08:25 +0100 Subject: [PATCH] python3Packages.msrest: switch to pytestCheckHook and clean-up --- .../python-modules/msrest/default.nix | 71 +++++++++++-------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/pkgs/development/python-modules/msrest/default.nix b/pkgs/development/python-modules/msrest/default.nix index 6eb6e49cddda..da130f289fda 100644 --- a/pkgs/development/python-modules/msrest/default.nix +++ b/pkgs/development/python-modules/msrest/default.nix @@ -1,51 +1,66 @@ { lib -, buildPythonPackage -, fetchFromGitHub -, isPy3k -, requests -, requests_oauthlib -, isodate -, certifi -, enum34 ? null -, typing -, aiohttp , aiodns -, pytest +, aiohttp +, buildPythonPackage +, certifi +, fetchFromGitHub , httpretty -, mock -, futures ? null +, isodate +, pytest-aiohttp +, pytestCheckHook +, pythonOlder +, requests +, requests-oauthlib , trio }: buildPythonPackage rec { - version = "0.6.21"; pname = "msrest"; + version = "0.6.21"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; - # no tests in PyPI tarball - # see https://github.com/Azure/msrest-for-python/pull/152 src = fetchFromGitHub { owner = "Azure"; repo = "msrest-for-python"; rev = "v${version}"; - sha256 = "sha256-IlBwlVQ/v+vJmCWNbFZKGL6a9K09z4AYrPm3kwaA/nI="; + hash = "sha256-IlBwlVQ/v+vJmCWNbFZKGL6a9K09z4AYrPm3kwaA/nI="; }; propagatedBuildInputs = [ - requests requests_oauthlib isodate certifi - ] ++ lib.optionals (!isPy3k) [ enum34 typing ] - ++ lib.optionals isPy3k [ aiohttp aiodns ]; + aiodns + aiohttp + certifi + isodate + requests + requests-oauthlib + ]; - checkInputs = [ pytest httpretty ] - ++ lib.optionals (!isPy3k) [ mock futures ] - ++ lib.optional isPy3k trio; + checkInputs = [ + httpretty + pytest-aiohttp + pytestCheckHook + trio + ]; - # Deselected tests require network access - checkPhase = '' - pytest tests/ -k "not test_conf_async_trio_requests" - ''; + disabledTests = [ + # Test require network access + "test_basic_aiohttp" + "test_basic_aiohttp" + "test_basic_async_requests" + "test_basic_async_requests" + "test_conf_async_requests" + "test_conf_async_requests" + "test_conf_async_trio_requests" + ]; + + pythonImportsCheck = [ + "msrest" + ]; meta = with lib; { - description = "The runtime library 'msrest' for AutoRest generated Python clients."; + description = "The runtime library for AutoRest generated Python clients"; homepage = "https://github.com/Azure/msrest-for-python"; license = licenses.mit; maintainers = with maintainers; [ bendlas jonringer maxwilson ];