1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytest-asyncio
5, pytest-mock
6, pytestCheckHook
7, python-socks
8, pythonOlder
9, tldextract
10, whodap
11}:
12
13buildPythonPackage rec {
14 pname = "asyncwhois";
15 version = "1.0.9";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "pogzyb";
22 repo = "asyncwhois";
23 rev = "refs/tags/v${version}";
24 hash = "sha256-5T/h4YzODH7zFyQpG8qVZetTK7V+Ii9jc+MQFgMUA8w=";
25 };
26
27 propagatedBuildInputs = [
28 python-socks
29 tldextract
30 whodap
31 ];
32
33 nativeCheckInputs = [
34 pytest-asyncio
35 pytest-mock
36 pytestCheckHook
37 ];
38
39 postPatch = ''
40 substituteInPlace setup.py \
41 --replace "python-socks[asyncio]" "python-socks"
42 '';
43
44 disabledTests = [
45 # Tests require network access
46 "test_pywhois_aio_get_hostname_from_ip"
47 "test_pywhois_get_hostname_from_ip"
48 "test_pywhois_aio_lookup_ipv4"
49 "test_not_found"
50 "test_aio_from_whois_cmd"
51 "test_aio_get_hostname_from_ip"
52 "test_from_whois_cmd"
53 "test_get_hostname_from_ip"
54 "test_whois_query_run"
55 "test_whois_query_create_connection"
56 "test_whois_query_send_and_recv"
57 "test_input_parameters_for_domain_query"
58 "test__get_top_level_domain"
59 ];
60
61 pythonImportsCheck = [
62 "asyncwhois"
63 ];
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 = with licenses; [ asl20 ];
70 maintainers = with maintainers; [ fab ];
71 };
72}