2021-07-14 22:03:04 +00:00
|
|
|
{ lib
|
2023-02-02 18:25:31 +00:00
|
|
|
, aiohttp
|
|
|
|
, async-timeout
|
2021-07-14 22:03:04 +00:00
|
|
|
, buildPythonPackage
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchFromGitHub
|
2024-04-21 15:54:59 +00:00
|
|
|
, fetchpatch
|
2020-08-20 17:08:02 +00:00
|
|
|
, pytest-aiohttp
|
2023-02-02 18:25:31 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, setuptools
|
2020-08-20 17:08:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aiojobs";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "1.2.1";
|
2023-02-02 18:25:31 +00:00
|
|
|
format = "pyproject";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aio-libs";
|
2023-11-16 04:20:00 +00:00
|
|
|
repo = "aiojobs";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-LwFXb/SHP6bbqPg1tqYwE03FKHf4Mv1PPOxnPdESH0I=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/aio-libs/aiojobs/commit/1b88049841397b01f88aee7d92174ac5a15217c1.patch";
|
|
|
|
hash = "sha256-b38Ipa29T6bEVsPe04ZO3WCcs6+0fOQDCJM+w8K1bVY=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
postPatch = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
substituteInPlace pytest.ini \
|
|
|
|
--replace "--cov=aiojobs/ --cov=tests/ --cov-report term" ""
|
2023-02-02 18:25:31 +00:00
|
|
|
'';
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
nativeBuildInputs = [
|
2023-02-02 18:25:31 +00:00
|
|
|
setuptools
|
2020-08-20 17:08:02 +00:00
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
propagatedBuildInputs = lib.optionals (pythonOlder "3.11") [
|
2023-02-02 18:25:31 +00:00
|
|
|
async-timeout
|
2020-08-20 17:08:02 +00:00
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
aiohttp = [
|
|
|
|
aiohttp
|
|
|
|
];
|
|
|
|
};
|
2023-08-22 20:05:09 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-07-14 22:03:04 +00:00
|
|
|
pytestCheckHook
|
2020-08-20 17:08:02 +00:00
|
|
|
pytest-aiohttp
|
2023-11-16 04:20:00 +00:00
|
|
|
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"aiojobs"
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
disabledTests = [
|
|
|
|
# RuntimeWarning: coroutine 'Scheduler._wait_failed' was never awaited
|
|
|
|
"test_scheduler_must_be_created_within_running_loop"
|
|
|
|
];
|
|
|
|
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Jobs scheduler for managing background task (asyncio)";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://github.com/aio-libs/aiojobs";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/aio-libs/aiojobs/blob/v${version}/CHANGES.rst";
|
2020-08-20 17:08:02 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ cmcdragonkai ];
|
|
|
|
};
|
|
|
|
}
|