Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / gql / default.nix
blob25b5ed25bae42f2b7a28c4654ba5dd20150a75a2
1 { lib
2 , aiofiles
3 , aiohttp
4 , anyio
5 , backoff
6 , botocore
7 , buildPythonPackage
8 , fetchFromGitHub
9 , graphql-core
10 , httpx
11 , mock
12 , parse
13 , pytest-asyncio
14 , pytest-console-scripts
15 , pytestCheckHook
16 , pythonOlder
17 , requests
18 , requests-toolbelt
19 , setuptools
20 , urllib3
21 , vcrpy
22 , websockets
23 , yarl
26 buildPythonPackage rec {
27   pname = "gql";
28   version = "3.5.0";
29   pyproject = true;
31   disabled = pythonOlder "3.7";
33   src = fetchFromGitHub {
34     owner = "graphql-python";
35     repo = pname;
36     rev = "refs/tags/v${version}";
37     hash = "sha256-jm0X+X8gQyQYn03gT14bdr79+Wd5KL9ryvrU/0VUtEU=";
38   };
40   postPatch = ''
41     substituteInPlace setup.py --replace \
42       "websockets>=10,<11;python_version>'3.6'" \
43       "websockets>=10,<12;python_version>'3.6'"
44   '';
46   build-system = [
47     setuptools
48   ];
50   dependencies = [
51     anyio
52     backoff
53     graphql-core
54     yarl
55   ];
57   nativeCheckInputs = [
58     aiofiles
59     mock
60     parse
61     pytest-asyncio
62     pytest-console-scripts
63     pytestCheckHook
64     vcrpy
65   ] ++ optional-dependencies.all;
67   optional-dependencies = {
68     all = [
69       aiohttp
70       botocore
71       httpx
72       requests
73       requests-toolbelt
74       urllib3
75       websockets
76     ];
77     aiohttp = [
78       aiohttp
79     ];
80     httpx = [
81       httpx
82     ];
83     requests = [
84       requests
85       requests-toolbelt
86       urllib3
87     ];
88     websockets = [
89       websockets
90     ];
91     botocore = [
92       botocore
93     ];
94   };
96   preCheck = ''
97     export PATH=$out/bin:$PATH
98   '';
100   pytestFlagsArray = [
101     "--asyncio-mode=auto"
102   ];
104   disabledTests = [
105     # Tests requires network access
106     "test_execute_result_error"
107     "test_http_transport"
108   ];
110   disabledTestPaths = [
111     # Exclude linter tests
112     "gql-checker/tests/test_flake8_linter.py"
113     "gql-checker/tests/test_pylama_linter.py"
114     # Tests require network access
115     "tests/custom_scalars/test_money.py"
116     "tests/test_aiohttp.py"
117     "tests/test_appsync_http.py"
118     "tests/test_appsync_websockets.py"
119     "tests/test_async_client_validation.py"
120     "tests/test_graphqlws_exceptions.py"
121     "tests/test_graphqlws_subscription.py"
122     "tests/test_phoenix_channel_exceptions.py"
123     "tests/test_phoenix_channel_exceptions.py"
124     "tests/test_phoenix_channel_query.py"
125     "tests/test_phoenix_channel_subscription.py"
126     "tests/test_requests.py"
127     "tests/test_websocket_exceptions.py"
128     "tests/test_websocket_query.py"
129     "tests/test_websocket_subscription.py"
130   ];
132   pythonImportsCheck = [
133     "gql"
134   ];
136   meta = with lib; {
137     description = "GraphQL client in Python";
138     mainProgram = "gql-cli";
139     homepage = "https://github.com/graphql-python/gql";
140     changelog = "https://github.com/graphql-python/gql/releases/tag/v${version}";
141     license = with licenses; [ mit ];
142     maintainers = with maintainers; [ fab ];
143   };