nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv
2, lib
3, buildPythonPackage
4, fetchFromGitHub
5, pythonOlder
6, idna
7, sniffio
8, typing-extensions
9, curio
10, hypothesis
11, pytestCheckHook
12, trio
13, trustme
14, uvloop
15}:
16
17buildPythonPackage rec {
18 pname = "anyio";
19 version = "2.2.0";
20 format = "pyproject";
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "agronholm";
25 repo = pname;
26 rev = version;
27 sha256 = "0ram1niv2lg9qj53zssph104a4kxl8f94ilfn6mibn034m3ikcc8";
28 };
29
30 propagatedBuildInputs = [
31 idna
32 sniffio
33 ] ++ lib.optionals (pythonOlder "3.8") [
34 typing-extensions
35 ];
36
37 checkInputs = [
38 curio
39 hypothesis
40 pytestCheckHook
41 trio
42 trustme
43 uvloop
44 ];
45
46 pytestFlagsArray = [
47 # lots of DNS lookups
48 "--ignore=tests/test_sockets.py"
49 ] ++ lib.optionals stdenv.isDarwin [
50 # darwin sandboxing limitations
51 "--ignore=tests/streams/test_tls.py"
52 ];
53
54 pythonImportsCheck = [ "anyio" ];
55
56 meta = with lib; {
57 description = "High level compatibility layer for multiple asynchronous event loop implementations on Python";
58 homepage = "https://github.com/agronholm/anyio";
59 license = licenses.mit;
60 maintainers = with maintainers; [ hexa ];
61 };
62}