about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/async-dns/default.nix
blob: fdf240f5ba968e95cbf0cfc698a3450db5eff6bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, poetry-core
, python
, pythonOlder
}:

buildPythonPackage rec {
  pname = "async-dns";
  version = "1.1.9";
  disabled = pythonOlder "3.6";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "gera2ld";
    repo = "async_dns";
    rev = "v${version}";
    sha256 = "1z8j0s3dwcyavarhx41q75k1cmfzmwiqdh4svv3v15np26cywyag";
  };

  nativeBuildInputs = [
    poetry-core
  ];

  patches = [
    # Switch to poetry-core, https://github.com/gera2ld/async_dns/pull/22
    # Can be remove for async-dns>1.1.9
    (fetchpatch {
      name = "switch-to-poetry-core.patch";
      url = "https://github.com/gera2ld/async_dns/commit/25fee497aae3bde0ddf9f8804d249a27edbe607e.patch";
      sha256 = "0w4zlppnp1a2q1wasc95ymqx3djswl32y5nw6fvz3nn8jg4gc743";
    })
  ];

  checkPhase = ''
    export HOME=$TMPDIR
    # Test needs network access
    rm tests/test_resolver.py
    ${python.interpreter} -m unittest
  '';

  pythonImportsCheck = [ "async_dns" ];

  meta = with lib; {
    description = "Python DNS library";
    homepage = "https://github.com/gera2ld/async_dns";
    license = with licenses; [ mit ];
    maintainers = with maintainers; [ fab ];
  };
}