1{ lib
2, asynctest
3, buildPythonPackage
4, fetchFromGitHub
5, pytestCheckHook
6, python-socks
7, pythonOlder
8, tldextract
9, whodap
10}:
11
12buildPythonPackage rec {
13 pname = "asyncwhois";
14 version = "1.0.1";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "pogzyb";
21 repo = pname;
22 rev = "v${version}";
23 hash = "sha256-TpUiUW9ntrpuT/rUhucedl+DM5X88Mislrd+3D5/TUE=";
24 };
25
26 propagatedBuildInputs = [
27 python-socks
28 tldextract
29 whodap
30 ];
31
32 checkInputs = [
33 asynctest
34 pytestCheckHook
35 ];
36
37 postPatch = ''
38 substituteInPlace setup.py \
39 --replace "python-socks[asyncio]" "python-socks"
40 '';
41
42 disabledTests = [
43 # Tests require network access
44 "test_pywhois_aio_get_hostname_from_ip"
45 "test_pywhois_get_hostname_from_ip"
46 "test_pywhois_aio_lookup_ipv4"
47 "test_not_found"
48 "test_aio_from_whois_cmd"
49 "test_aio_get_hostname_from_ip"
50 "test_from_whois_cmd"
51 "test_get_hostname_from_ip"
52 "test_whois_query_run"
53 "test_whois_query_create_connection"
54 "test_whois_query_send_and_recv"
55 ];
56
57 pythonImportsCheck = [
58 "asyncwhois"
59 ];
60
61 meta = with lib; {
62 description = "Python module for retrieving WHOIS information";
63 homepage = "https://github.com/pogzyb/asyncwhois";
64 license = with licenses; [ asl20 ];
65 maintainers = with maintainers; [ fab ];
66 };
67}