1{ lib
2, buildPythonPackage
3, factory-boy
4, faker
5, fetchPypi
6, pytestCheckHook
7, pythonOlder
8}:
9
10buildPythonPackage rec {
11 pname = "tld";
12 version = "0.13";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchPypi {
18 inherit pname version;
19 hash = "sha256-k93l4cBL3xhEl26uRAcGN50h9KsjW3PAXXSD4HT7Vik=";
20 };
21
22 postPatch = ''
23 sed -i "/--cov/d" pytest.ini
24 '';
25
26 nativeCheckInputs = [
27 pytestCheckHook
28 ];
29
30 checkInputs = [
31 factory-boy
32 faker
33 ];
34
35 # These tests require network access, but disabledTestPaths doesn't work.
36 # the file needs to be `import`ed by another Python test file, so it
37 # can't simply be removed.
38 preCheck = ''
39 echo > src/tld/tests/test_commands.py
40 '';
41
42 pythonImportsCheck = [
43 "tld"
44 ];
45
46 meta = with lib; {
47 description = "Extracts the top level domain (TLD) from the URL given";
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; [ lgpl21Plus mpl11 gpl2Only ];
53 maintainers = with maintainers; [ fab ];
54 };
55}