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 ] ++ python-socks.optional-dependencies.asyncio;
38
39 nativeCheckInputs = [
40 pytest-asyncio
41 pytest-mock
42 pytestCheckHook
43 ];
44
45 disabledTests = [
46 # Tests require network access
47 "test_pywhois_aio_get_hostname_from_ip"
48 "test_pywhois_get_hostname_from_ip"
49 "test_pywhois_aio_lookup_ipv4"
50 "test_not_found"
51 "test_aio_from_whois_cmd"
52 "test_aio_get_hostname_from_ip"
53 "test_from_whois_cmd"
54 "test_get_hostname_from_ip"
55 "test_whois_query_run"
56 "test_whois_query_create_connection"
57 "test_whois_query_send_and_recv"
58 "test_input_parameters_for_domain_query"
59 "test__get_top_level_domain"
60 ];
61
62 pythonImportsCheck = [ "asyncwhois" ];
63
64 meta = with lib; {
65 description = "Python module for retrieving WHOIS information";
66 homepage = "https://github.com/pogzyb/asyncwhois";
67 changelog = "https://github.com/pogzyb/asyncwhois/releases/tag/v${version}";
68 license = licenses.asl20;
69 maintainers = with maintainers; [ fab ];
70 };
71}