From bb106d0ccf12b5885e02bd09e77198bce05e2214 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Feb 2024 13:48:55 +0100 Subject: [PATCH] python312Packages.msrestazure: refactor --- .../python-modules/msrestazure/default.nix | 53 +++++++++++-------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/msrestazure/default.nix b/pkgs/development/python-modules/msrestazure/default.nix index e564a0fd5959..b997cd9b5065 100644 --- a/pkgs/development/python-modules/msrestazure/default.nix +++ b/pkgs/development/python-modules/msrestazure/default.nix @@ -1,41 +1,52 @@ -{ pkgs -, lib +{ lib +, adal , buildPythonPackage , fetchFromGitHub -, isPy3k -, adal -, msrest -, mock , httpretty -, pytest +, mock +, msrest , pytest-asyncio +, pytestCheckHook +, pythonOlder +, setuptools }: buildPythonPackage rec { - version = "0.6.4"; - format = "setuptools"; pname = "msrestazure"; + version = "0.6.4"; + pyproject = true; + + disabled = pythonOlder "3.7"; - # Pypi tarball doesnt include tests - # see https://github.com/Azure/msrestazure-for-python/pull/133 src = fetchFromGitHub { owner = "Azure"; repo = "msrestazure-for-python"; - rev = "v${version}"; - sha256 = "0ik81f0n6r27f02gblgm0vl5zl3wc6ijsscihgvc1fgm9f5mk5b5"; + rev = "refs/tags/v${version}"; + hash = "sha256-ZZVZi0v1ucD2g5FpLaNhfNBf6Ab10fUEcEdkY4ELaEY="; }; - propagatedBuildInputs = [ adal msrest ]; + nativeBuildInputs = [ + setuptools + ]; - nativeCheckInputs = [ httpretty mock pytest ] - ++ lib.optionals isPy3k [ pytest-asyncio ]; + propagatedBuildInputs = [ + adal + msrest + ]; - checkPhase = '' - pytest tests/ - ''; + nativeCheckInputs = [ + httpretty + mock + pytest-asyncio + pytestCheckHook + ]; - meta = with pkgs.lib; { - description = "The runtime library 'msrestazure' for AutoRest generated Python clients."; + pythonImportsCheck = [ + "msrest" + ]; + + meta = with lib; { + description = "The runtime library 'msrestazure' for AutoRest generated Python clients"; homepage = "https://azure.microsoft.com/en-us/develop/python/"; license = licenses.mit; maintainers = with maintainers; [ bendlas jonringer ];