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