1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 setuptools, 6}: 7let 8 tagVersion = "2.2019-12-21"; 9in 10buildPythonPackage { 11 pname = "publicsuffix2"; 12 # tags have dashes, while the library version does not 13 # see https://github.com/nexB/python-publicsuffix2/issues/12 14 version = lib.replaceStrings [ "-" ] [ "" ] tagVersion; 15 pyproject = true; 16 17 src = fetchFromGitHub { 18 owner = "nexB"; 19 repo = "python-publicsuffix2"; 20 rev = "release-${tagVersion}"; 21 hash = "sha256-OV0O4LLxQ2LQiEHc1JTvScu35o2IWxo/hgn/COh2e7Y="; 22 }; 23 24 build-system = [ setuptools ]; 25 26 postPatch = '' 27 # only used to update the interal publicsuffix list 28 substituteInPlace setup.py \ 29 --replace "'requests >= 2.7.0'," "" 30 ''; 31 32 pythonImportsCheck = [ "publicsuffix2" ]; 33 34 meta = with lib; { 35 description = "Get a public suffix for a domain name using the Public Suffix List"; 36 homepage = "https://github.com/nexB/python-publicsuffix2"; 37 license = licenses.mpl20; 38 maintainers = [ ]; 39 }; 40}