Merge pull request #41804 from Assassinkin/python-hosts

pythonPackages.python-hosts: init at 0.4.1
This commit is contained in:
Frederik Rietdijk 2018-06-10 20:25:10 +02:00 committed by GitHub
commit 2114e15171
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

@ -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 ];
};
}

@ -420,6 +420,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) { };