From 9cfb08f439eb01f5bd37c7ed26cb251cec35f33c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 10 Jun 2023 18:45:55 +0200 Subject: [PATCH] python311Packages.packet-python: remove pytest-runner - add format - add chagnelog to meta - add pythonImportsCheck - switch to pytestCheckHook - disable on unsupported Python releases --- .../python-modules/packet-python/default.nix | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/packet-python/default.nix b/pkgs/development/python-modules/packet-python/default.nix index 2d33c3f57233..8c88e6dc6ea7 100644 --- a/pkgs/development/python-modules/packet-python/default.nix +++ b/pkgs/development/python-modules/packet-python/default.nix @@ -1,38 +1,47 @@ { lib , buildPythonPackage , fetchPypi +, pytestCheckHook +, pythonOlder , requests -, python - -# For tests/setup.py -, pytest -, pytest-runner , requests-mock }: buildPythonPackage rec { pname = "packet-python"; version = "1.44.3"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + src = fetchPypi { inherit pname version; hash = "sha256-WVfMELOoml7Hx78jy6TAwlFRLuSQu9dtsb6Khs6/cgI="; }; - nativeBuildInputs = [ pytest-runner ]; - propagatedBuildInputs = [ requests ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "pytest-runner" "" + ''; + + propagatedBuildInputs = [ + requests + ]; + nativeCheckInputs = [ - pytest - pytest-runner + pytestCheckHook requests-mock ]; - checkPhase = '' - ${python.interpreter} setup.py test - ''; + pythonImportsCheck = [ + "packet" + ]; - meta = { - description = "A Python client for the Packet API."; - homepage = "https://github.com/packethost/packet-python"; - license = lib.licenses.lgpl3; - maintainers = with lib.maintainers; [ dipinhora ]; + meta = with lib; { + description = "Python client for the Packet API"; + homepage = "https://github.com/packethost/packet-python"; + changelog = "https://github.com/packethost/packet-python/blob/v${version}/CHANGELOG.md"; + license = licenses.lgpl3Only; + maintainers = with maintainers; [ dipinhora ]; }; }