From 0d76f09f1544f5fb0ebb09a76a804031d6496f34 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 12 Apr 2024 17:35:14 +0200 Subject: [PATCH] python312Packages.publicsuffix: refactor --- .../python-modules/publicsuffix/default.nix | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/publicsuffix/default.nix b/pkgs/development/python-modules/publicsuffix/default.nix index 9de169f696dd..6423340b2379 100644 --- a/pkgs/development/python-modules/publicsuffix/default.nix +++ b/pkgs/development/python-modules/publicsuffix/default.nix @@ -1,25 +1,40 @@ -{ lib, buildPythonPackage, fetchPypi }: +{ lib +, buildPythonPackage +, fetchPypi +, setuptools +, pythonOlder +}: buildPythonPackage rec { pname = "publicsuffix"; version = "1.1.1"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "22ce1d65ab6af5e9b2122e2443facdb93fb5c4abf24138099cb10fe7989f43b6"; + hash = "sha256-Is4dZatq9emyEi4kQ/rNuT+1xKvyQTgJnLEP55ifQ7Y="; }; - # disable test_fetch and the doctests (which also invoke fetch) postPatch = '' sed -i -e "/def test_fetch/i\\ \\t@unittest.skip('requires internet')" -e "/def additional_tests():/,+1d" tests.py ''; + build-system = [ + setuptools + ]; + + pythonImportsCheck = [ + "publicsuffix" + ]; + meta = with lib; { description = "Allows to get the public suffix of a domain name"; homepage = "https://pypi.python.org/pypi/publicsuffix/"; license = licenses.mit; + maintainers = with maintainers; [ ]; }; }