From dce3dd59addbd29711165b1d090a1c27a2c200c3 Mon Sep 17 00:00:00 2001 From: natsukium Date: Tue, 4 Jun 2024 20:14:12 +0900 Subject: [PATCH] python311Packages.iptools: refactor and remove nose --- .../python-modules/iptools/default.nix | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/iptools/default.nix b/pkgs/development/python-modules/iptools/default.nix index 42e296afcc86..c3d14b161c02 100644 --- a/pkgs/development/python-modules/iptools/default.nix +++ b/pkgs/development/python-modules/iptools/default.nix @@ -1,25 +1,34 @@ { lib, buildPythonPackage, - fetchPypi, - nose, + fetchFromGitHub, + pytestCheckHook, + setuptools, }: buildPythonPackage rec { version = "0.7.0"; - format = "setuptools"; pname = "iptools"; + pyproject = true; - src = fetchPypi { - inherit pname version; - sha256 = "1sp2v76qqsgqjk0vqfbm2s4sc4mi0gkkpzjnvwih3ymmidilz2hi"; + src = fetchFromGitHub { + owner = "bd808"; + repo = "python-iptools"; + rev = "refs/tags/v${version}"; + hash = "sha256-340Wc4QGwUqEEANM5EQzFaXxIWVf2fDr4qfCuxNEVBQ="; }; - buildInputs = [ nose ]; + build-system = [ setuptools ]; + + pythonImportsCheck = [ "iptools" ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pytestFlagsArray = [ "tests/iptools/iptools_test.py" ]; meta = with lib; { description = "Utilities for manipulating IP addresses including a class that can be used to include CIDR network blocks in Django's INTERNAL_IPS setting"; - homepage = "https://pypi.python.org/pypi/iptools"; + homepage = "https://github.com/bd808/python-iptools"; license = licenses.bsd0; }; }