1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 hatchling,
6 pytest-asyncio,
7 pytest-mock,
8 pytestCheckHook,
9 python-dateutil,
10 python-socks,
11 pythonOlder,
12 tldextract,
13 whodap,
14}:
15
16buildPythonPackage rec {
17 pname = "asyncwhois";
18 version = "1.1.10";
19 pyproject = true;
20
21 disabled = pythonOlder "3.9";
22
23 src = fetchFromGitHub {
24 owner = "pogzyb";
25 repo = "asyncwhois";
26 tag = "v${version}";
27 hash = "sha256-vNXz8a0tXMxgcJ3xGKyJFgxQuIxpBg/xUeeG1TPXB0E=";
28 };
29
30 build-system = [ hatchling ];
31
32 dependencies = [
33 python-dateutil
34 python-socks
35 tldextract
36 whodap
37 ]
38 ++ python-socks.optional-dependencies.asyncio;
39
40 nativeCheckInputs = [
41 pytest-asyncio
42 pytest-mock
43 pytestCheckHook
44 ];
45
46 disabledTests = [
47 # Tests require network access
48 "test_pywhois_aio_get_hostname_from_ip"
49 "test_pywhois_get_hostname_from_ip"
50 "test_pywhois_aio_lookup_ipv4"
51 "test_not_found"
52 "test_aio_from_whois_cmd"
53 "test_aio_get_hostname_from_ip"
54 "test_from_whois_cmd"
55 "test_get_hostname_from_ip"
56 "test_whois_query_run"
57 "test_whois_query_create_connection"
58 "test_whois_query_send_and_recv"
59 "test_input_parameters_for_domain_query"
60 "test__get_top_level_domain"
61 ];
62
63 pythonImportsCheck = [ "asyncwhois" ];
64
65 meta = with lib; {
66 description = "Python module for retrieving WHOIS information";
67 homepage = "https://github.com/pogzyb/asyncwhois";
68 changelog = "https://github.com/pogzyb/asyncwhois/releases/tag/v${version}";
69 license = licenses.asl20;
70 maintainers = with maintainers; [ fab ];
71 };
72}