2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
setuptools,
|
|
|
|
}:
|
2023-05-24 13:37:59 +00:00
|
|
|
let
|
|
|
|
tagVersion = "2.2019-12-21";
|
|
|
|
in
|
|
|
|
buildPythonPackage {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "publicsuffix2";
|
2023-05-24 13:37:59 +00:00
|
|
|
# tags have dashes, while the library version does not
|
|
|
|
# see https://github.com/nexB/python-publicsuffix2/issues/12
|
2024-04-21 15:54:59 +00:00
|
|
|
version = lib.replaceStrings [ "-" ] [ "" ] tagVersion;
|
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nexB";
|
|
|
|
repo = "python-publicsuffix2";
|
2023-05-24 13:37:59 +00:00
|
|
|
rev = "release-${tagVersion}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-OV0O4LLxQ2LQiEHc1JTvScu35o2IWxo/hgn/COh2e7Y=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
postPatch = ''
|
|
|
|
# only used to update the interal publicsuffix list
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "'requests >= 2.7.0'," ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "publicsuffix2" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-03-30 09:31:56 +00:00
|
|
|
description = "Get a public suffix for a domain name using the Public Suffix List";
|
|
|
|
homepage = "https://github.com/nexB/python-publicsuffix2";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mpl20;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|