nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 anyio,
4 buildPythonPackage,
5 fetchFromGitHub,
6 fetchpatch2,
7 hishel,
8 httpx,
9 pydantic,
10 pyjwt,
11 pytest-cov-stub,
12 pytest-xdist,
13 pytestCheckHook,
14 typing-extensions,
15 uv-build,
16}:
17
18buildPythonPackage rec {
19 pname = "githubkit";
20 version = "0.14.3";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "yanyongyu";
25 repo = "githubkit";
26 tag = "v${version}";
27 hash = "sha256-9fq0PNgQmKOhFyaEQcRZa+v0HDUMirkzFZxWi6NP5wg=";
28 };
29
30 patches = [
31 (fetchpatch2 {
32 name = "uv-build.patch";
33 url = "https://github.com/yanyongyu/githubkit/commit/2817664d904541242d4cedf7aae85cd4c4b606e2.patch?full_index=1";
34 hash = "sha256-mmtjlebHZpHX457frSOe88tsUo7iNdSIUynGZjcjuw4=";
35 })
36 ];
37
38 pythonRelaxDeps = [ "hishel" ];
39
40 build-system = [ uv-build ];
41
42 dependencies = [
43 hishel
44 httpx
45 pydantic
46 typing-extensions
47 ];
48
49 optional-dependencies = {
50 all = [
51 anyio
52 pyjwt
53 ];
54 jwt = [ pyjwt ];
55 auth-app = [ pyjwt ];
56 auth-oauth-device = [ anyio ];
57 auth = [
58 anyio
59 pyjwt
60 ];
61 };
62
63 nativeCheckInputs = [
64 pytestCheckHook
65 pytest-cov-stub
66 pytest-xdist
67 ]
68 ++ lib.concatAttrValues optional-dependencies;
69
70 pythonImportsCheck = [ "githubkit" ];
71
72 disabledTests = [
73 # Tests require network access
74 "test_graphql"
75 "test_async_graphql"
76 "test_call"
77 "test_async_call"
78 "test_versioned_call"
79 "test_versioned_async_call"
80 ];
81
82 meta = {
83 description = "GitHub SDK for Python";
84 homepage = "https://github.com/yanyongyu/githubkit";
85 changelog = "https://github.com/yanyongyu/githubkit/releases/tag/${src.tag}";
86 license = lib.licenses.mit;
87 maintainers = [ ];
88 };
89}