1{ lib
2, aiofiles
3, aiohttp
4, backoff
5, botocore
6, buildPythonPackage
7, fetchFromGitHub
8, graphql-core
9, mock
10, parse
11, pytest-asyncio
12, pytest-console-scripts
13, pytestCheckHook
14, pythonOlder
15, requests
16, requests-toolbelt
17, urllib3
18, vcrpy
19, websockets
20, yarl
21}:
22
23buildPythonPackage rec {
24 pname = "gql";
25 version = "3.4.0";
26 format = "setuptools";
27
28 disabled = pythonOlder "3.7";
29
30 src = fetchFromGitHub {
31 owner = "graphql-python";
32 repo = pname;
33 rev = "refs/tags/v${version}";
34 hash = "sha256-yr8IyAwZ6y2MPTe6bHRW+CIp19R3ZJWHuqdN5qultnQ=";
35 };
36
37 propagatedBuildInputs = [
38 backoff
39 graphql-core
40 yarl
41 ];
42
43 checkInputs = [
44 aiofiles
45 mock
46 parse
47 pytest-asyncio
48 pytest-console-scripts
49 pytestCheckHook
50 vcrpy
51 ] ++ passthru.optional-dependencies.all;
52
53 passthru.optional-dependencies = {
54 all = [
55 aiohttp
56 botocore
57 requests
58 requests-toolbelt
59 urllib3
60 websockets
61 ];
62 aiohttp = [
63 aiohttp
64 ];
65 requests = [
66 requests
67 requests-toolbelt
68 urllib3
69 ];
70 websockets = [
71 websockets
72 ];
73 botocore = [
74 botocore
75 ];
76 };
77
78 preCheck = ''
79 export PATH=$out/bin:$PATH
80 '';
81
82 pytestFlagsArray = [
83 "--asyncio-mode=auto"
84 ];
85
86 disabledTests = [
87 # Tests requires network access
88 "test_execute_result_error"
89 "test_http_transport"
90 ];
91
92 disabledTestPaths = [
93 # Exclude linter tests
94 "gql-checker/tests/test_flake8_linter.py"
95 "gql-checker/tests/test_pylama_linter.py"
96 ];
97
98 pythonImportsCheck = [
99 "gql"
100 ];
101
102 meta = with lib; {
103 description = "GraphQL client in Python";
104 homepage = "https://github.com/graphql-python/gql";
105 license = with licenses; [ mit ];
106 maintainers = with maintainers; [ fab ];
107 };
108}