2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
2024-10-11 05:15:48 +00:00
|
|
|
defusedxml,
|
2024-06-05 15:53:02 +00:00
|
|
|
dnspython,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
iana-etc,
|
|
|
|
libredirect,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
2023-03-15 16:39:30 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ipwhois";
|
2024-10-11 05:15:48 +00:00
|
|
|
version = "1.3.0";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "secynic";
|
2024-02-07 01:22:34 +00:00
|
|
|
repo = "ipwhois";
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-10-11 05:15:48 +00:00
|
|
|
hash = "sha256-PY3SUPELcCvS/o5kfko4OD1BlTc9DnyqfkSFuzcAOSY=";
|
2023-03-15 16:39:30 +00:00
|
|
|
};
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonRelaxDeps = [ "dnspython" ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-10-11 05:15:48 +00:00
|
|
|
build-system = [ setuptools ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-10-11 05:15:48 +00:00
|
|
|
dependencies = [
|
|
|
|
defusedxml
|
|
|
|
dnspython
|
|
|
|
];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "ipwhois" ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
preCheck = lib.optionalString stdenv.hostPlatform.isLinux ''
|
2023-03-15 16:39:30 +00:00
|
|
|
echo "nameserver 127.0.0.1" > resolv.conf
|
|
|
|
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf) \
|
|
|
|
LD_PRELOAD=${libredirect}/lib/libredirect.so
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Tests require network access
|
|
|
|
"ipwhois/tests/online/"
|
2024-02-07 01:22:34 +00:00
|
|
|
# Stress test
|
|
|
|
"ipwhois/tests/stress/test_experimental.py"
|
2023-03-15 16:39:30 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_lookup"
|
|
|
|
"test_unique_addresses"
|
|
|
|
"test_get_http_json"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Library to retrieve and parse whois data";
|
|
|
|
homepage = "https://github.com/secynic/ipwhois";
|
|
|
|
changelog = "https://github.com/secynic/ipwhois/blob/v${version}/CHANGES.rst";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|