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";
|
2022-03-05 16:20:37 +00:00
|
|
|
version = "1.0.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-4SAXjx5pRDhv4YVUgrUttyUa5izpYqpDKiiGJc2y8V0=";
|
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" ""
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ 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 ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|