1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pytestCheckHook,
6 pythonOlder,
7 pyyaml,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "python-hosts";
13 version = "1.0.7";
14 pyproject = true;
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchPypi {
19 pname = "python_hosts";
20 inherit version;
21 hash = "sha256-TFaZHiL2v/woCWgz3nh/kjUOhbfN1ghnBnJcVcTwSrk=";
22 };
23
24 build-system = [ setuptools ];
25
26 nativeCheckInputs = [
27 pyyaml
28 pytestCheckHook
29 ];
30
31 pythonImportsCheck = [ "python_hosts" ];
32
33 disabledTests = [
34 # Tests require network access
35 "test_import_from_url_counters_for_part_success"
36 "test_import_from_url_with_force"
37 "test_import_from_url_without_force"
38 "test_import_from_url"
39 ];
40
41 meta = with lib; {
42 description = "Library for managing a hosts file";
43 longDescription = ''
44 python-hosts is a Python library for managing a hosts file. It enables you to add
45 and remove entries, or import them from a file or URL.
46 '';
47 homepage = "https://github.com/jonhadfield/python-hosts";
48 changelog = "https://github.com/jonhadfield/python-hosts/blob/${version}/CHANGELOG.md";
49 license = licenses.mit;
50 maintainers = with maintainers; [ psyanticy ];
51 };
52}