1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, pythonOlder
6, setuptools-scm
7, pytestCheckHook
8, cacert
9}:
10
11buildPythonPackage rec {
12 pname = "dnspython";
13 version = "2.2.1";
14 disabled = pythonOlder "3.6";
15
16 src = fetchPypi {
17 inherit pname version;
18 extension = "tar.gz";
19 sha256 = "0gk00m8zxjghxnzafhars51k5ahd6wfhf123nrc1j5gzlsj6jx8g";
20 };
21
22 checkInputs = [
23 pytestCheckHook
24 ] ++ lib.optionals stdenv.isDarwin [
25 cacert
26 ];
27
28 disabledTests = [
29 # dns.exception.SyntaxError: protocol not found
30 "test_misc_good_WKS_text"
31 # fails if IPv6 isn't available
32 "test_resolver_override"
33
34 # Tests that run inconsistently on darwin systems
35 ] ++ lib.optionals stdenv.isDarwin [
36 # 9 tests fail with: BlockingIOError: [Errno 35] Resource temporarily unavailable
37 "testQueryUDP"
38 # 6 tests fail with: dns.resolver.LifetimeTimeout: The resolution lifetime expired after ...
39 "testResolveCacheHit"
40 "testResolveTCP"
41 ];
42
43 nativeBuildInputs = [
44 setuptools-scm
45 ];
46
47 pythonImportsCheck = [ "dns" ];
48
49 meta = with lib; {
50 description = "A DNS toolkit for Python";
51 homepage = "https://www.dnspython.org";
52 license = with licenses; [ isc ];
53 maintainers = with maintainers; [ gador ];
54 };
55}