2021-12-30 13:39:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2024-05-15 15:35:15 +00:00
|
|
|
, fetchFromGitHub
|
2024-01-13 08:15:51 +00:00
|
|
|
, setuptools
|
2024-04-21 15:54:59 +00:00
|
|
|
, greenlet
|
2021-12-30 13:39:12 +00:00
|
|
|
, trio
|
|
|
|
, outcome
|
|
|
|
, sniffio
|
2024-01-13 08:15:51 +00:00
|
|
|
, exceptiongroup
|
2021-12-30 13:39:12 +00:00
|
|
|
, pytest-trio
|
|
|
|
, pytestCheckHook
|
2022-02-20 05:27:41 +00:00
|
|
|
, pythonOlder
|
2021-12-30 13:39:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "trio-asyncio";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.14.1";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2022-02-20 05:27:41 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2021-12-30 13:39:12 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-trio";
|
|
|
|
repo = "trio-asyncio";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-634fcYAn5J1WW71J/USAMkJaZI8JmKoQneQEhz2gYFc=";
|
2021-12-30 13:39:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail '"pytest-runner"' ""
|
2021-12-30 13:39:12 +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 = [
|
2024-04-21 15:54:59 +00:00
|
|
|
greenlet
|
2021-12-30 13:39:12 +00:00
|
|
|
trio
|
|
|
|
outcome
|
|
|
|
sniffio
|
2024-01-13 08:15:51 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
exceptiongroup
|
2021-12-30 13:39:12 +00:00
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
# RuntimeWarning: Can't run the Python asyncio tests because they're not installed
|
|
|
|
"-W" "ignore::RuntimeWarning"
|
|
|
|
];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-30 13:39:12 +00:00
|
|
|
pytest-trio
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"trio_asyncio"
|
|
|
|
];
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
meta = with lib; {
|
2024-01-13 08:15:51 +00:00
|
|
|
changelog = "https://github.com/python-trio/trio-asyncio/blob/v${version}/docs/source/history.rst";
|
2021-12-30 13:39:12 +00:00
|
|
|
description = "Re-implementation of the asyncio mainloop on top of Trio";
|
|
|
|
homepage = "https://github.com/python-trio/trio-asyncio";
|
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|