2020-04-24 23:36:52 +00:00
|
|
|
{ lib, buildPythonPackage, fetchPypi, pythonOlder
|
|
|
|
, attrs
|
|
|
|
, sortedcontainers
|
|
|
|
, async_generator
|
2023-01-20 10:41:00 +00:00
|
|
|
, exceptiongroup
|
2020-04-24 23:36:52 +00:00
|
|
|
, idna
|
|
|
|
, outcome
|
2020-09-25 04:45:31 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, pyopenssl
|
|
|
|
, trustme
|
|
|
|
, sniffio
|
|
|
|
, stdenv
|
|
|
|
, jedi
|
|
|
|
, astor
|
|
|
|
, yapf
|
2022-04-15 01:41:22 +00:00
|
|
|
, coreutils
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "trio";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.22.0";
|
|
|
|
format = "setuptools";
|
2022-12-17 10:02:37 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-01-20 10:41:00 +00:00
|
|
|
hash = "sha256-zmjxxUAKR7E3xaTecsfJAb1OeiT73r/ptB3oxsBOqs8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
attrs
|
|
|
|
sortedcontainers
|
|
|
|
async_generator
|
|
|
|
idna
|
|
|
|
outcome
|
|
|
|
sniffio
|
2023-01-20 10:41:00 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
exceptiongroup
|
2022-12-17 10:02:37 +00:00
|
|
|
];
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
# tests are failing on Darwin
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-04-15 01:41:22 +00:00
|
|
|
astor
|
|
|
|
jedi
|
|
|
|
pyopenssl
|
|
|
|
pytestCheckHook
|
|
|
|
trustme
|
|
|
|
yapf
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
substituteInPlace trio/tests/test_subprocess.py \
|
|
|
|
--replace "/bin/sleep" "${coreutils}/bin/sleep"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# It appears that the build sandbox doesn't include /etc/services, and these tests try to use it.
|
2020-09-25 04:45:31 +00:00
|
|
|
disabledTests = [
|
|
|
|
"getnameinfo"
|
|
|
|
"SocketType_resolve"
|
|
|
|
"getprotobyname"
|
|
|
|
"waitpid"
|
|
|
|
"static_tool_sees_all_symbols"
|
2021-03-19 17:17:44 +00:00
|
|
|
# tests pytest more than python
|
|
|
|
"fallback_when_no_hook_claims_it"
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"-W" "ignore::DeprecationWarning"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "An async/await-native I/O library for humans and snake people";
|
|
|
|
homepage = "https://github.com/python-trio/trio";
|
|
|
|
license = with lib.licenses; [ mit asl20 ];
|
|
|
|
maintainers = with lib.maintainers; [ catern ];
|
|
|
|
};
|
|
|
|
}
|