anki-bin: 24.06.3 -> 24.11 (#360722)
[NixPkgs.git] / pkgs / development / python-modules / gql / default.nix
blobf6067dab3b6da54be34016abd2711b9d5486d35d
2   lib,
3   aiofiles,
4   aiohttp,
5   anyio,
6   backoff,
7   botocore,
8   buildPythonPackage,
9   fetchFromGitHub,
10   graphql-core,
11   httpx,
12   mock,
13   parse,
14   pytest-asyncio,
15   pytest-console-scripts,
16   pytestCheckHook,
17   pythonOlder,
18   requests,
19   requests-toolbelt,
20   setuptools,
21   urllib3,
22   vcrpy,
23   websockets,
24   yarl,
27 buildPythonPackage rec {
28   pname = "gql";
29   version = "3.5.0";
30   pyproject = true;
32   disabled = pythonOlder "3.7";
34   src = fetchFromGitHub {
35     owner = "graphql-python";
36     repo = "gql";
37     rev = "refs/tags/v${version}";
38     hash = "sha256-jm0X+X8gQyQYn03gT14bdr79+Wd5KL9ryvrU/0VUtEU=";
39   };
41   postPatch = ''
42     substituteInPlace setup.py --replace \
43       "websockets>=10,<11;python_version>'3.6'" \
44       "websockets>=10,<12;python_version>'3.6'"
45   '';
47   build-system = [ setuptools ];
49   dependencies = [
50     anyio
51     backoff
52     graphql-core
53     yarl
54   ];
56   nativeCheckInputs = [
57     aiofiles
58     mock
59     parse
60     pytest-asyncio
61     pytest-console-scripts
62     pytestCheckHook
63     vcrpy
64   ] ++ optional-dependencies.all;
66   optional-dependencies = {
67     all = [
68       aiohttp
69       botocore
70       httpx
71       requests
72       requests-toolbelt
73       urllib3
74       websockets
75     ];
76     aiohttp = [ aiohttp ];
77     httpx = [ httpx ];
78     requests = [
79       requests
80       requests-toolbelt
81       urllib3
82     ];
83     websockets = [ websockets ];
84     botocore = [ botocore ];
85   };
87   preCheck = ''
88     export PATH=$out/bin:$PATH
89   '';
91   pytestFlagsArray = [
92     "--asyncio-mode=auto"
93     "-m 'not online'"
94   ];
96   disabledTests = [
97     # Tests requires network access
98     "test_async_client_validation_fetch_schema_from_server_valid_query"
99     "test_execute_result_error"
100     "test_get_introspection_query_ast"
101     "test_header_query"
102     "test_hero_name_query"
103     "test_http_transport"
104     "test_named_query"
105     "test_query_with_variable"
106   ];
108   disabledTestPaths = [
109     # Exclude linter tests
110     "gql-checker/tests/test_flake8_linter.py"
111     "gql-checker/tests/test_pylama_linter.py"
112   ];
114   pythonImportsCheck = [ "gql" ];
116   meta = with lib; {
117     description = "GraphQL client in Python";
118     homepage = "https://github.com/graphql-python/gql";
119     changelog = "https://github.com/graphql-python/gql/releases/tag/v${version}";
120     license = with licenses; [ mit ];
121     maintainers = with maintainers; [ fab ];
122     mainProgram = "gql-cli";
123   };