summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/tld/default.nix
blob: d1224750f409faf5c64429ece32b5109a392ca48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
  lib,
  buildPythonPackage,
  factory-boy,
  faker,
  fetchPypi,
  pytestCheckHook,
  pytest-cov-stub,
}:

buildPythonPackage rec {
  pname = "tld";
  version = "0.13.1";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-dewAk2y89WT2c2HEFxM2NEC2xO8PDBWStbD75ywXo1A=";
  };

  nativeCheckInputs = [
    pytestCheckHook
    pytest-cov-stub
  ];

  checkInputs = [
    factory-boy
    faker
  ];

  doCheck = false; # missing pytest-codeblock

  # These tests require network access, but disabledTestPaths doesn't work.
  # the file needs to be `import`ed by another Python test file, so it
  # can't simply be removed.
  preCheck = ''
    echo > src/tld/tests/test_commands.py
  '';

  pythonImportsCheck = [ "tld" ];

  meta = {
    description = "Extracts the top level domain (TLD) from the URL given";
    mainProgram = "update-tld-names";
    homepage = "https://github.com/barseghyanartur/tld";
    changelog = "https://github.com/barseghyanartur/tld/blob/${version}/CHANGELOG.rst";
    # https://github.com/barseghyanartur/tld/blob/master/README.rst#license
    # MPL-1.1 OR GPL-2.0-only OR LGPL-2.1-or-later
    license = with lib.licenses; [
      lgpl21Plus
      mpl11
      gpl2Only
    ];
    maintainers = with lib.maintainers; [ fab ];
  };
}