depot/third_party/nixpkgs/pkgs/development/python-modules/trio-asyncio/default.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

67 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
greenlet,
trio,
outcome,
sniffio,
exceptiongroup,
pytest-trio,
pytestCheckHook,
pythonOlder,
}:
buildPythonPackage rec {
pname = "trio-asyncio";
version = "0.15.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "python-trio";
repo = "trio-asyncio";
rev = "refs/tags/v${version}";
hash = "sha256-6c+4sGEpCVC8wxBg+dYgkOwRAUOi/DTITrDx3M2koyE=";
};
postPatch = ''
substituteInPlace setup.py \
--replace-fail '"pytest-runner"' ""
'';
build-system = [ setuptools ];
dependencies = [
greenlet
trio
outcome
sniffio
] ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ];
pytestFlagsArray = [
# RuntimeWarning: Can't run the Python asyncio tests because they're not installed
"-W"
"ignore::RuntimeWarning"
];
nativeCheckInputs = [
pytest-trio
pytestCheckHook
];
pythonImportsCheck = [ "trio_asyncio" ];
meta = with lib; {
changelog = "https://github.com/python-trio/trio-asyncio/blob/v${version}/docs/source/history.rst";
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 ];
};
}