ttaenc: init at 3.4.1 (#238757)
[NixPkgs.git] / pkgs / development / python-modules / ipwhois / default.nix
blobabdcb10e9eb21dcac58a265c872b26428b06802b
2   lib,
3   stdenv,
4   buildPythonPackage,
5   defusedxml,
6   dnspython,
7   fetchFromGitHub,
8   fetchpatch,
9   iana-etc,
10   libredirect,
11   pytestCheckHook,
12   pythonOlder,
13   setuptools,
16 buildPythonPackage rec {
17   pname = "ipwhois";
18   version = "1.3.0";
19   pyproject = true;
21   disabled = pythonOlder "3.7";
23   src = fetchFromGitHub {
24     owner = "secynic";
25     repo = "ipwhois";
26     rev = "refs/tags/v${version}";
27     hash = "sha256-PY3SUPELcCvS/o5kfko4OD1BlTc9DnyqfkSFuzcAOSY=";
28   };
30   __darwinAllowLocalNetworking = true;
32   pythonRelaxDeps = [ "dnspython" ];
34   build-system = [ setuptools ];
36   dependencies = [
37     defusedxml
38     dnspython
39   ];
41   nativeCheckInputs = [ pytestCheckHook ];
43   pythonImportsCheck = [ "ipwhois" ];
45   preCheck = lib.optionalString stdenv.hostPlatform.isLinux ''
46     echo "nameserver 127.0.0.1" > resolv.conf
47     export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf) \
48       LD_PRELOAD=${libredirect}/lib/libredirect.so
49   '';
51   disabledTestPaths = [
52     # Tests require network access
53     "ipwhois/tests/online/"
54     # Stress test
55     "ipwhois/tests/stress/test_experimental.py"
56   ];
58   disabledTests = [
59     "test_lookup"
60     "test_unique_addresses"
61     "test_get_http_json"
62   ];
64   meta = with lib; {
65     description = "Library to retrieve and parse whois data";
66     homepage = "https://github.com/secynic/ipwhois";
67     changelog = "https://github.com/secynic/ipwhois/blob/v${version}/CHANGES.rst";
68     license = licenses.bsd2;
69     maintainers = with maintainers; [ fab ];
70   };