2021-07-24 12:14:16 +00:00
|
|
|
{ lib, buildPythonPackage, fetchPypi, pyyaml, pytest, pytest-cov }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-hosts";
|
2021-09-23 15:35:13 +00:00
|
|
|
version = "1.0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-09-23 15:35:13 +00:00
|
|
|
sha256 = "8f827da4a1bf69d4f4f881f7d7ebc8b378967b60924aa4baea2c9d1debedf5fc";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# 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" ""
|
|
|
|
'';
|
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
checkInputs = [ pyyaml pytest pytest-cov ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|