Commit 0d76f09f authored by Fabian Affolter's avatar Fabian Affolter
Browse files

python312Packages.publicsuffix: refactor

parent 5244ff28
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
{ 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; [ ];
  };
}