2024-01-13 08:15:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2024-05-15 15:35:15 +00:00
|
|
|
, fetchFromGitHub
|
2024-01-13 08:15:51 +00:00
|
|
|
, pythonOlder
|
|
|
|
, stdenv
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
, setuptools
|
|
|
|
|
|
|
|
# dependencies
|
2020-04-24 23:36:52 +00:00
|
|
|
, attrs
|
2023-01-20 10:41:00 +00:00
|
|
|
, exceptiongroup
|
2020-04-24 23:36:52 +00:00
|
|
|
, idna
|
|
|
|
, outcome
|
2024-01-13 08:15:51 +00:00
|
|
|
, sniffio
|
|
|
|
, sortedcontainers
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, astor
|
|
|
|
, coreutils
|
|
|
|
, jedi
|
|
|
|
, pyopenssl
|
2020-09-25 04:45:31 +00:00
|
|
|
, pytestCheckHook
|
2023-11-16 04:20:00 +00:00
|
|
|
, pytest-trio
|
2020-04-24 23:36:52 +00:00
|
|
|
, trustme
|
|
|
|
, yapf
|
|
|
|
}:
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
let
|
|
|
|
# escape infinite recursion with pytest-trio
|
|
|
|
pytest-trio' = (pytest-trio.override {
|
|
|
|
trio = null;
|
|
|
|
}).overrideAttrs {
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [];
|
|
|
|
};
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "trio";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.25.0";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-trio";
|
|
|
|
repo = "trio";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-JQ493U4WINOG6ob4IzfNQt5Lgs3DmEM2BDwbae7Bvsw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [
|
2024-01-13 08:15:51 +00:00
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2022-04-15 01:41:22 +00:00
|
|
|
attrs
|
|
|
|
idna
|
|
|
|
outcome
|
|
|
|
sniffio
|
2024-01-13 08:15:51 +00:00
|
|
|
sortedcontainers
|
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
|
2023-11-16 04:20:00 +00:00
|
|
|
pytest-trio'
|
2022-04-15 01:41:22 +00:00
|
|
|
trustme
|
|
|
|
yapf
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
export HOME=$TMPDIR
|
2024-04-21 15:54:59 +00:00
|
|
|
# $out is first in path which causes "import file mismatch"
|
|
|
|
PYTHONPATH=$PWD/src:$PYTHONPATH
|
2022-04-15 01:41:22 +00:00
|
|
|
'';
|
|
|
|
|
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"
|
2023-11-16 04:20:00 +00:00
|
|
|
# requires mypy
|
|
|
|
"test_static_tool_sees_class_members"
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# linters
|
2024-04-21 15:54:59 +00:00
|
|
|
"src/trio/_tests/tools/test_gen_exports.py"
|
2024-01-13 08:15:51 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
2024-05-15 15:35:15 +00:00
|
|
|
changelog = "https://github.com/python-trio/trio/blob/v${version}/docs/source/history.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|