1{
2 lib,
3 buildPythonPackage,
4 factory-boy,
5 faker,
6 fetchPypi,
7 pytestCheckHook,
8 pytest-cov-stub,
9 pythonOlder,
10}:
11
12buildPythonPackage rec {
13 pname = "tld";
14 version = "0.13.1";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-dewAk2y89WT2c2HEFxM2NEC2xO8PDBWStbD75ywXo1A=";
22 };
23
24 nativeCheckInputs = [
25 pytestCheckHook
26 pytest-cov-stub
27 ];
28
29 checkInputs = [
30 factory-boy
31 faker
32 ];
33
34 doCheck = false; # missing pytest-codeblock
35
36 # These tests require network access, but disabledTestPaths doesn't work.
37 # the file needs to be `import`ed by another Python test file, so it
38 # can't simply be removed.
39 preCheck = ''
40 echo > src/tld/tests/test_commands.py
41 '';
42
43 pythonImportsCheck = [ "tld" ];
44
45 meta = with lib; {
46 description = "Extracts the top level domain (TLD) from the URL given";
47 mainProgram = "update-tld-names";
48 homepage = "https://github.com/barseghyanartur/tld";
49 changelog = "https://github.com/barseghyanartur/tld/blob/${version}/CHANGELOG.rst";
50 # https://github.com/barseghyanartur/tld/blob/master/README.rst#license
51 # MPL-1.1 OR GPL-2.0-only OR LGPL-2.1-or-later
52 license = with licenses; [
53 lgpl21Plus
54 mpl11
55 gpl2Only
56 ];
57 maintainers = with maintainers; [ fab ];
58 };
59}