summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/packet-python
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2023-06-10 18:45:55 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2023-06-10 18:45:55 +0200
commit9cfb08f439eb01f5bd37c7ed26cb251cec35f33c (patch)
treed9914c9db86a68621e8f21f90296ddcbf2eeb0d2 /pkgs/development/python-modules/packet-python
parentd6da3621aa7c94afe41bcfb4c6245c631b41ca9e (diff)
python311Packages.packet-python: remove pytest-runner
- add format - add chagnelog to meta - add pythonImportsCheck - switch to pytestCheckHook - disable on unsupported Python releases
Diffstat (limited to 'pkgs/development/python-modules/packet-python')
-rw-r--r--pkgs/development/python-modules/packet-python/default.nix43
1 files 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 ];
};
}