1{ lib
2, buildPythonPackage
3, fetchPypi
4, filelock
5, idna
6, pytest-mock
7, pytestCheckHook
8, pythonOlder
9, requests
10, requests-file
11, responses
12, setuptools
13, setuptools-scm
14}:
15
16buildPythonPackage rec {
17 pname = "tldextract";
18 version = "3.6.0";
19 format = "pyproject";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-pdi2WDeR2sominWS6892QVL6SWF5g8SZFu6d6Zs2YiI=";
26 };
27
28 nativeBuildInputs = [
29 setuptools
30 setuptools-scm
31 ];
32
33 propagatedBuildInputs = [
34 filelock
35 idna
36 requests
37 requests-file
38 ];
39
40 nativeCheckInputs = [
41 pytest-mock
42 pytestCheckHook
43 responses
44 ];
45
46 postPatch = ''
47 substituteInPlace pytest.ini \
48 --replace " --pylint" ""
49 '';
50
51 pythonImportsCheck = [
52 "tldextract"
53 ];
54
55 meta = with lib; {
56 description = "Python module to accurately separate the TLD from the domain of an URL";
57 longDescription = ''
58 tldextract accurately separates the gTLD or ccTLD (generic or country code top-level domain)
59 from the registered domain and subdomains of a URL.
60 '';
61 homepage = "https://github.com/john-kurkowski/tldextract";
62 license = with licenses; [ bsd3 ];
63 maintainers = with maintainers; [ fab ];
64 };
65}