nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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 sigstore,
13 writableTmpDirAsHomeHook,
14}:
15
16buildPythonPackage rec {
17 pname = "aiogithubapi";
18 version = "25.5.0";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "ludeeus";
23 repo = "aiogithubapi";
24 tag = version;
25 hash = "sha256-zl9QpFpkvSTs0BUDMBmwTeLY1YvNRSqbkIZ5LDUP3zw=";
26 };
27
28 __darwinAllowLocalNetworking = true;
29
30 postPatch = ''
31 # Upstream is releasing with the help of a CI to PyPI, GitHub releases
32 # are not in their focus
33 substituteInPlace pyproject.toml \
34 --replace-fail 'version = "0"' 'version = "${version}"'
35 '';
36
37 pythonRelaxDeps = [ "async-timeout" ];
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 writableTmpDirAsHomeHook
55 ];
56
57 pytestFlags = [ "--asyncio-mode=auto" ];
58
59 preCheck = ''
60 # Need sigstore is an optional dependencies and need <2
61 rm -rf tests/test_helper.py
62 '';
63
64 pythonImportsCheck = [ "aiogithubapi" ];
65
66 meta = {
67 description = "Python client for the GitHub API";
68 homepage = "https://github.com/ludeeus/aiogithubapi";
69 changelog = "https://github.com/ludeeus/aiogithubapi/releases/tag/${version}";
70 license = lib.licenses.mit;
71 maintainers = with lib.maintainers; [ fab ];
72 };
73}