1{
2 lib,
3 aiohttp,
4 async-timeout,
5 buildPythonPackage,
6 fetchFromGitHub,
7 pytest-aiohttp,
8 pytest-cov-stub,
9 pytestCheckHook,
10 pythonOlder,
11 setuptools,
12}:
13
14buildPythonPackage rec {
15 pname = "aiojobs";
16 version = "1.4.0";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "aio-libs";
23 repo = "aiojobs";
24 tag = "v${version}";
25 hash = "sha256-MgGUmDG0b0V/k+mCeiVRnBxa+ChK3URnGv6P8QP7RzQ=";
26 };
27
28 nativeBuildInputs = [ setuptools ];
29
30 propagatedBuildInputs = lib.optionals (pythonOlder "3.11") [ async-timeout ];
31
32 optional-dependencies = {
33 aiohttp = [ aiohttp ];
34 };
35
36 nativeCheckInputs = [
37 pytestCheckHook
38 pytest-aiohttp
39 pytest-cov-stub
40 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
41
42 pythonImportsCheck = [ "aiojobs" ];
43
44 disabledTests = [
45 # RuntimeWarning: coroutine 'Scheduler._wait_failed' was never awaited
46 "test_scheduler_must_be_created_within_running_loop"
47 ];
48
49 __darwinAllowLocalNetworking = true;
50
51 meta = {
52 description = "Jobs scheduler for managing background task (asyncio)";
53 homepage = "https://github.com/aio-libs/aiojobs";
54 changelog = "https://github.com/aio-libs/aiojobs/blob/${src.tag}/CHANGES.rst";
55 license = lib.licenses.asl20;
56 maintainers = with lib.maintainers; [ cmcdragonkai ];
57 };
58}