depot/third_party/nixpkgs/pkgs/development/python-modules/python-hosts/default.nix
Default email 2ce89355c3 Project import generated by Copybara.
GitOrigin-RevId: 22a81aa5fc15b2d41b12f7160a71cd4a9f3c3fa1
2020-06-15 17:56:04 +02:00

33 lines
1 KiB
Nix

{ stdenv, buildPythonPackage, fetchPypi, pyyaml, pytest, pytestcov }:
buildPythonPackage rec {
pname = "python-hosts";
version = "1.0.0";
src = fetchPypi {
inherit pname version;
sha256 = "850998704ba9025ce4c8ffd45dc4fbea2b5e30247bf3b574872ac5df90426b4d";
};
# 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 ];
};
}