1{
2 lib,
3 aiohttp,
4 aresponses,
5 async-timeout,
6 backoff,
7 buildPythonPackage,
8 fetchFromGitHub,
9 poetry-core,
10 pytest-asyncio,
11 pytestCheckHook,
12 pythonOlder,
13 sigstore,
14}:
15
16buildPythonPackage rec {
17 pname = "aiogithubapi";
18 version = "24.6.0";
19 pyproject = true;
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchFromGitHub {
24 owner = "ludeeus";
25 repo = "aiogithubapi";
26 rev = "refs/tags/${version}";
27 hash = "sha256-z7l7Qx9Kg1FZ9nM0V2NzTyi3gbE2hakbc/GZ1CzDmKw=";
28 };
29
30 __darwinAllowLocalNetworking = true;
31
32 postPatch = ''
33 # Upstream is releasing with the help of a CI to PyPI, GitHub releases
34 # are not in their focus
35 substituteInPlace pyproject.toml \
36 --replace-fail 'version = "0"' 'version = "${version}"'
37 '';
38
39 build-system = [ poetry-core ];
40
41 dependencies = [
42 aiohttp
43 async-timeout
44 backoff
45 ];
46
47 # Optional dependencies for deprecated-verify are not added
48 # Only sigstore < 2 is supported
49
50 nativeCheckInputs = [
51 aresponses
52 pytest-asyncio
53 pytestCheckHook
54 sigstore
55 ];
56
57 pytestFlagsArray = [ "--asyncio-mode=auto" ];
58
59 preCheck = ''
60 export HOME=$(mktemp -d)
61 '';
62
63 pythonImportsCheck = [ "aiogithubapi" ];
64
65 disabledTests = [
66 # sigstore.errors.TUFError: Failed to refresh TUF metadata
67 "test_sigstore"
68 ];
69
70 meta = with lib; {
71 description = "Python client for the GitHub API";
72 homepage = "https://github.com/ludeeus/aiogithubapi";
73 changelog = "https://github.com/ludeeus/aiogithubapi/releases/tag/${version}";
74 license = licenses.mit;
75 maintainers = with maintainers; [ fab ];
76 };
77}