summary refs log tree commit diff
diff options
context:
space:
mode:
authornagato.pain <iuns@outlook.fr>2018-06-10 11:04:20 -0700
committernagato.pain <iuns@outlook.fr>2018-06-10 11:04:20 -0700
commit95120f51092da50b2fed1f79afc966440b222fe3 (patch)
tree356599d35e4b718fe23639882e5e55b7bb499e71
parent7edfd9dbe15b865a4db6da81cc97697de2f8ff79 (diff)
downloadnixlib-95120f51092da50b2fed1f79afc966440b222fe3.tar
nixlib-95120f51092da50b2fed1f79afc966440b222fe3.tar.gz
nixlib-95120f51092da50b2fed1f79afc966440b222fe3.tar.bz2
nixlib-95120f51092da50b2fed1f79afc966440b222fe3.tar.lz
nixlib-95120f51092da50b2fed1f79afc966440b222fe3.tar.xz
nixlib-95120f51092da50b2fed1f79afc966440b222fe3.tar.zst
nixlib-95120f51092da50b2fed1f79afc966440b222fe3.zip
pythonPakchages.python-hosts: init at 0.4.1
-rw-r--r--pkgs/development/python-modules/python-hosts/default.nix33
-rw-r--r--pkgs/top-level/python-packages.nix2
2 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/python-hosts/default.nix b/pkgs/development/python-modules/python-hosts/default.nix
new file mode 100644
index 000000000000..08c617d750c3
--- /dev/null
+++ b/pkgs/development/python-modules/python-hosts/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, buildPythonPackage, fetchPypi, pyyaml, pytest, pytestcov }:
+
+buildPythonPackage rec {
+  pname = "python-hosts";
+  version = "0.4.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "4a169a4669bddb720c032ef0132203ff8a7b6646266f7e6ab349177bab02b3ba";
+  };
+
+  # win_inet_pton is required for windows support
+  prePatch = ''
+    substituteInPlace setup.py --replace "install_requires=['win_inet_pton']," ""
+    substituteInPlace python_hosts/utils.py --replace "import win_inet_pton" ""
+  '';
+
+  checkInputs = [ pyyaml pytest pytestcov ];
+
+  # Removing 1 test file (it requires internet connection) and keeping the other two
+  checkPhase = ''
+    pytest tests/test_hosts_entry.py
+    pytest tests/test_utils.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A library for managing a hosts file. It enables adding and removing entries, or importing them from a file or URL";
+    homepage = https://github.com/jonhadfield/python-hosts;
+    license = licenses.mit;
+    maintainers = with maintainers; [ psyanticy ];
+  };
+}
+
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 0a230853087c..a0a3953804af 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -410,6 +410,8 @@ in {
 
   pytest-tornado = callPackage ../development/python-modules/pytest-tornado { };
 
+  python-hosts = callPackage ../development/python-modules/python-hosts { };
+
   python-openid = callPackage (if isPy3k
     then ../development/python-modules/python3-openid
     else ../development/python-modules/python-openid) { };