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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
# build-system
setuptools,
# dependencies
attrs,
exceptiongroup,
idna,
outcome,
sniffio,
sortedcontainers,
# tests
astor,
jedi,
pyopenssl,
pytestCheckHook,
pytest-trio,
pyyaml,
trustme,
}:
let
# escape infinite recursion with pytest-trio
pytest-trio' = (pytest-trio.override { trio = null; }).overrideAttrs {
# `pythonRemoveDeps` is not working properly
dontCheckRuntimeDeps = true;
doCheck = false;
pythonImportsCheck = [ ];
};
in
buildPythonPackage rec {
pname = "trio";
version = "0.32.0";
pyproject = true;
src = fetchFromGitHub {
owner = "python-trio";
repo = "trio";
tag = "v${version}";
hash = "sha256-kZKP5TFg9M+NCx9V9B0qNbGiwZtBPtgVKgZYjX5w1ok=";
};
build-system = [ setuptools ];
dependencies = [
attrs
idna
outcome
sniffio
sortedcontainers
]
++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ];
__darwinAllowLocalNetworking = true;
nativeCheckInputs = [
astor
pyopenssl
pytestCheckHook
pytest-trio'
pyyaml
trustme
]
# jedi has no compatibility with python 3.14 yet
# https://github.com/davidhalter/jedi/issues/2064
++ lib.optional (pythonOlder "3.14") jedi;
preCheck = ''
export HOME=$TMPDIR
# $out is first in path which causes "import file mismatch"
PYTHONPATH=$PWD/src:$PYTHONPATH
'';
pytestFlags = [
"-Wignore::DeprecationWarning"
];
# It appears that the build sandbox doesn't include /etc/services, and these tests try to use it.
disabledTests = [
"getnameinfo"
"SocketType_resolve"
"getprotobyname"
"waitpid"
"static_tool_sees_all_symbols"
# tests pytest more than python
"fallback_when_no_hook_claims_it"
# requires mypy
"test_static_tool_sees_class_members"
];
disabledTestPaths = [
# linters
"src/trio/_tests/tools/test_gen_exports.py"
];
meta = {
changelog = "https://github.com/python-trio/trio/blob/${src.tag}/docs/source/history.rst";
description = "Async/await-native I/O library for humans and snake people";
homepage = "https://github.com/python-trio/trio";
license = with lib.licenses; [
mit
asl20
];
};
}
|