ps3-disc-dumper: 3.2.3 -> 4.2.5, .NET 6 -> 9 (#361506)
[NixPkgs.git] / pkgs / development / python-modules / trio / default.nix
bloba29bcd8424019c2f408381b9ad8010cefd3d7a5b
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   pythonOlder,
6   stdenv,
8   # build-system
9   setuptools,
11   # dependencies
12   attrs,
13   exceptiongroup,
14   idna,
15   outcome,
16   sniffio,
17   sortedcontainers,
19   # tests
20   astor,
21   coreutils,
22   jedi,
23   pyopenssl,
24   pytestCheckHook,
25   pytest-trio,
26   trustme,
27   yapf,
30 let
31   # escape infinite recursion with pytest-trio
32   pytest-trio' = (pytest-trio.override { trio = null; }).overrideAttrs {
33     doCheck = false;
34     pythonImportsCheck = [ ];
35   };
37 buildPythonPackage rec {
38   pname = "trio";
39   version = "0.26.2";
40   pyproject = true;
42   disabled = pythonOlder "3.8";
44   src = fetchFromGitHub {
45     owner = "python-trio";
46     repo = "trio";
47     rev = "refs/tags/v${version}";
48     hash = "sha256-Vlm6lEMKKfwmhbeefPjxm3vz1zFRUEGOCHXLcZKQcIo=";
49   };
51   build-system = [ setuptools ];
53   dependencies = [
54     attrs
55     idna
56     outcome
57     sniffio
58     sortedcontainers
59   ] ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ];
61   # tests are failing on Darwin
62   doCheck = !stdenv.hostPlatform.isDarwin;
64   nativeCheckInputs = [
65     astor
66     jedi
67     pyopenssl
68     pytestCheckHook
69     pytest-trio'
70     trustme
71     yapf
72   ];
74   preCheck = ''
75     export HOME=$TMPDIR
76     # $out is first in path which causes "import file mismatch"
77     PYTHONPATH=$PWD/src:$PYTHONPATH
78   '';
80   # It appears that the build sandbox doesn't include /etc/services, and these tests try to use it.
81   disabledTests = [
82     "getnameinfo"
83     "SocketType_resolve"
84     "getprotobyname"
85     "waitpid"
86     "static_tool_sees_all_symbols"
87     # tests pytest more than python
88     "fallback_when_no_hook_claims_it"
89     # requires mypy
90     "test_static_tool_sees_class_members"
91   ];
93   disabledTestPaths = [
94     # linters
95     "src/trio/_tests/tools/test_gen_exports.py"
96   ];
98   meta = {
99     changelog = "https://github.com/python-trio/trio/blob/v${version}/docs/source/history.rst";
100     description = "Async/await-native I/O library for humans and snake people";
101     homepage = "https://github.com/python-trio/trio";
102     license = with lib.licenses; [
103       mit
104       asl20
105     ];
106     maintainers = with lib.maintainers; [ catern ];
107   };