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