1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonOlder,
7 six,
8 tldextract,
9}:
10
11buildPythonPackage {
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 # nixpkgs-update: no auto update
23 rev = "6934c321b3e2f66af9c001d882475949f00570c5";
24 hash = "sha256-pSMNpFfq2V0ANWNFPcb1DwPHccbfddo9P4xZ+ghwbz4=";
25 };
26
27 propagatedBuildInputs = [
28 six
29 tldextract
30 ];
31
32 nativeCheckInputs = [ pytestCheckHook ];
33
34 pythonImportsCheck = [ "surt" ];
35
36 disabledTests = [
37 # Tests want to download Public Suffix List
38 "test_getPublicPrefix"
39 "test_getPublicSuffix"
40 ];
41
42 meta = with lib; {
43 description = "Sort-friendly URI Reordering Transform (SURT) python module";
44 homepage = "https://github.com/internetarchive/surt";
45 license = licenses.agpl3Only;
46 maintainers = with maintainers; [ Luflosi ];
47 };
48}