nixos/tests: fix bonding test (#375496)
[NixPkgs.git] / pkgs / development / python-modules / anyio / default.nix
blobada31a6d616c5f65723d7ce930a17ada8d093534
2   stdenv,
3   lib,
4   buildPythonPackage,
5   fetchFromGitHub,
6   pythonOlder,
8   # build-system
9   setuptools-scm,
11   # dependencies
12   exceptiongroup,
13   idna,
14   sniffio,
15   typing-extensions,
17   # optionals
18   trio,
20   # tests
21   hypothesis,
22   psutil,
23   pytest-mock,
24   pytest-xdist,
25   pytestCheckHook,
26   trustme,
27   uvloop,
29   # smoke tests
30   starlette,
33 buildPythonPackage rec {
34   pname = "anyio";
35   version = "4.6.2";
36   pyproject = true;
38   disabled = pythonOlder "3.8";
40   src = fetchFromGitHub {
41     owner = "agronholm";
42     repo = "anyio";
43     tag = version;
44     hash = "sha256-8QLOAjQpiNtbd+YSHfqcBVdtMSGJFRevOcacZErKuso=";
45   };
47   build-system = [ setuptools-scm ];
49   dependencies =
50     [
51       idna
52       sniffio
53     ]
54     ++ lib.optionals (pythonOlder "3.11") [
55       exceptiongroup
56       typing-extensions
57     ];
59   optional-dependencies = {
60     trio = [ trio ];
61   };
63   nativeCheckInputs = [
64     exceptiongroup
65     hypothesis
66     psutil
67     pytest-mock
68     pytest-xdist
69     pytestCheckHook
70     trustme
71     uvloop
72   ] ++ optional-dependencies.trio;
74   pytestFlagsArray = [
75     "-W"
76     "ignore::trio.TrioDeprecationWarning"
77     "-m"
78     "'not network'"
79   ];
81   disabledTests =
82     [
83       # TypeError: __subprocess_run() got an unexpected keyword argument 'umask'
84       "test_py39_arguments"
85       # AttributeError: 'module' object at __main__ has no attribute '__file__'
86       "test_nonexistent_main_module"
87       #  3 second timeout expired
88       "test_keyboardinterrupt_during_test"
89     ]
90     ++ lib.optionals stdenv.hostPlatform.isDarwin [
91       # PermissionError: [Errno 1] Operation not permitted: '/dev/console'
92       "test_is_block_device"
93     ];
95   disabledTestPaths = [
96     # lots of DNS lookups
97     "tests/test_sockets.py"
98   ];
100   __darwinAllowLocalNetworking = true;
102   pythonImportsCheck = [ "anyio" ];
104   passthru.tests = {
105     inherit starlette;
106   };
108   meta = with lib; {
109     changelog = "https://github.com/agronholm/anyio/blob/${src.rev}/docs/versionhistory.rst";
110     description = "High level compatibility layer for multiple asynchronous event loop implementations on Python";
111     homepage = "https://github.com/agronholm/anyio";
112     license = licenses.mit;
113     maintainers = with maintainers; [ hexa ];
114   };