1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonOlder,
7 six,
8 tldextract,
9}:
10
11buildPythonPackage rec {
12 pname = "surt";
13 version = "0.3.1";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "internetarchive";
20 repo = "surt";
21 # Has no git tag, https://github.com/internetarchive/surt/issues/26
22 rev = "6934c321b3e2f66af9c001d882475949f00570c5";
23 hash = "sha256-pSMNpFfq2V0ANWNFPcb1DwPHccbfddo9P4xZ+ghwbz4=";
24 };
25
26 propagatedBuildInputs = [
27 six
28 tldextract
29 ];
30
31 nativeCheckInputs = [ pytestCheckHook ];
32
33 pythonImportsCheck = [ "surt" ];
34
35 disabledTests = [
36 # Tests want to download Public Suffix List
37 "test_getPublicPrefix"
38 "test_getPublicSuffix"
39 ];
40
41 meta = with lib; {
42 description = "Sort-friendly URI Reordering Transform (SURT) python module";
43 homepage = "https://github.com/internetarchive/surt";
44 license = licenses.agpl3Only;
45 maintainers = with maintainers; [ Luflosi ];
46 };
47}