1{
2 lib,
3 aiofiles,
4 aiohttp,
5 anyio,
6 backoff,
7 botocore,
8 buildPythonPackage,
9 fetchFromGitHub,
10 graphql-core,
11 httpx,
12 parse,
13 pytest-asyncio_0,
14 pytest-console-scripts,
15 pytestCheckHook,
16 requests,
17 requests-toolbelt,
18 setuptools,
19 vcrpy,
20 websockets,
21 yarl,
22}:
23
24buildPythonPackage rec {
25 pname = "gql";
26 version = "4.0.0";
27 pyproject = true;
28
29 src = fetchFromGitHub {
30 owner = "graphql-python";
31 repo = "gql";
32 tag = "v${version}";
33 hash = "sha256-bPdlFN6MRT6G9Mw2g2BBfsOGpQmT7pbRatpqa7CImSs=";
34 };
35
36 build-system = [ setuptools ];
37
38 dependencies = [
39 anyio
40 backoff
41 graphql-core
42 yarl
43 ];
44
45 nativeCheckInputs = [
46 parse
47 pytest-asyncio_0
48 pytest-console-scripts
49 pytestCheckHook
50 vcrpy
51 ]
52 ++ optional-dependencies.all;
53
54 optional-dependencies = {
55 all = [
56 aiofiles
57 aiohttp
58 botocore
59 httpx
60 requests
61 requests-toolbelt
62 websockets
63 ];
64 aiofiles = [ aiofiles ];
65 aiohttp = [ aiohttp ];
66 httpx = [ httpx ];
67 requests = [
68 requests
69 requests-toolbelt
70 ];
71 websockets = [ websockets ];
72 botocore = [ botocore ];
73 };
74
75 preCheck = ''
76 export PATH=$out/bin:$PATH
77 '';
78
79 disabledTestMarks = [
80 "online"
81 ];
82
83 pythonImportsCheck = [ "gql" ];
84
85 __darwinAllowLocalNetworking = true;
86
87 meta = {
88 description = "GraphQL client in Python";
89 homepage = "https://github.com/graphql-python/gql";
90 changelog = "https://github.com/graphql-python/gql/releases/tag/${src.tag}";
91 license = lib.licenses.mit;
92 maintainers = with lib.maintainers; [ fab ];
93 mainProgram = "gql-cli";
94 };
95}