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 = "23.11.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-SbpfHKD4QJuCe3QG0GTvsffkuFiGPLEUXOVW9f1gyTI=";
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 'version = "0"' 'version = "${version}"' \
37 --replace 'backoff = "^1.10.0"' 'backoff = "*"' \
38 --replace 'sigstore = "<2"' 'sigstore = "*"'
39 '';
40
41 nativeBuildInputs = [ poetry-core ];
42
43 propagatedBuildInputs = [
44 aiohttp
45 async-timeout
46 backoff
47 sigstore
48 ];
49
50 nativeCheckInputs = [
51 aresponses
52 pytest-asyncio
53 pytestCheckHook
54 ];
55
56 pytestFlagsArray = [ "--asyncio-mode=auto" ];
57
58 preCheck = ''
59 export HOME=$(mktemp -d)
60 '';
61
62 pythonImportsCheck = [ "aiogithubapi" ];
63
64 disabledTests = [
65 # sigstore.errors.TUFError: Failed to refresh TUF metadata
66 "test_sigstore"
67 ];
68
69 meta = with lib; {
70 description = "Python client for the GitHub API";
71 homepage = "https://github.com/ludeeus/aiogithubapi";
72 changelog = "https://github.com/ludeeus/aiogithubapi/releases/tag/${version}";
73 license = with licenses; [ mit ];
74 maintainers = with maintainers; [ fab ];
75 };
76}