sgqlc 16.2__tar.gz → 16.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sgqlc-16.2 → sgqlc-16.4}/LICENSE +0 -1
- {sgqlc-16.2/sgqlc.egg-info → sgqlc-16.4}/PKG-INFO +48 -40
- {sgqlc-16.2 → sgqlc-16.4}/README.rst +29 -30
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/conf.py +3 -4
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.endpoint.base.rst +0 -1
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.rst +0 -1
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.types.datetime.rst +0 -1
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.types.relay.rst +0 -1
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.types.uuid.rst +0 -1
- sgqlc-16.4/pyproject.toml +85 -0
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/__init__.py +1 -1
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/codegen/__init__.py +12 -6
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/codegen/operation.py +155 -77
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/codegen/schema.py +212 -122
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/endpoint/base.py +23 -13
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/endpoint/http.py +137 -78
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/endpoint/requests.py +170 -98
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/endpoint/websocket.py +25 -11
- sgqlc-16.4/sgqlc/introspection/__main__.py +92 -0
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/operation/__init__.py +127 -60
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/types/__init__.py +148 -72
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/types/datetime.py +17 -11
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/types/relay.py +9 -4
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/types/uuid.py +5 -5
- {sgqlc-16.2 → sgqlc-16.4}/tests/test-endpoint-http.py +145 -120
- {sgqlc-16.2 → sgqlc-16.4}/tests/test-endpoint-requests.py +168 -138
- {sgqlc-16.2 → sgqlc-16.4}/tests/test-endpoint-websocket.py +61 -69
- sgqlc-16.4/tests/test-operation-codegen.py +232 -0
- sgqlc-16.2/MANIFEST.in +0 -6
- sgqlc-16.2/PKG-INFO +0 -561
- sgqlc-16.2/pyproject.toml +0 -3
- sgqlc-16.2/setup.cfg +0 -53
- sgqlc-16.2/setup.py +0 -69
- sgqlc-16.2/sgqlc/introspection/__main__.py +0 -68
- sgqlc-16.2/sgqlc.egg-info/SOURCES.txt +0 -53
- sgqlc-16.2/sgqlc.egg-info/dependency_links.txt +0 -1
- sgqlc-16.2/sgqlc.egg-info/entry_points.txt +0 -2
- sgqlc-16.2/sgqlc.egg-info/requires.txt +0 -11
- sgqlc-16.2/sgqlc.egg-info/top_level.txt +0 -1
- sgqlc-16.2/sgqlc.egg-info/zip-safe +0 -1
- {sgqlc-16.2 → sgqlc-16.4}/AUTHORS +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/_static/.keepme +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/_static/logo-sgqlc.png +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/favicon-sgqlc.png +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/index.rst +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.codegen.rst +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.endpoint.http.rst +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.endpoint.requests.rst +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.endpoint.rst +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.endpoint.websocket.rst +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.introspection.rst +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.operation.rst +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/doc/source/sgqlc.types.rst +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/codegen/__main__.py +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/endpoint/__init__.py +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/sgqlc/introspection/__init__.py +0 -0
- {sgqlc-16.2 → sgqlc-16.4}/tests/test-introspection.py +0 -0
|
@@ -1,28 +1,36 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sgqlc
|
|
3
|
-
Version: 16.
|
|
3
|
+
Version: 16.4
|
|
4
4
|
Summary: Simple GraphQL Client
|
|
5
5
|
Home-page: http://github.com/profusion/sgqlc
|
|
6
|
+
License: ISCL
|
|
7
|
+
Keywords: graphql,client,http,endpoint
|
|
6
8
|
Author: Gustavo Sverzut Barbieri
|
|
7
9
|
Author-email: barbieri@profusion.mobi
|
|
8
|
-
|
|
9
|
-
Keywords: graphql client http endpoint
|
|
10
|
-
Platform: any
|
|
10
|
+
Requires-Python: >=3.8,<3.13
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Environment :: Console
|
|
13
13
|
Classifier: Environment :: Web Environment
|
|
14
14
|
Classifier: Intended Audience :: Developers
|
|
15
15
|
Classifier: License :: OSI Approved :: ISC License (ISCL)
|
|
16
|
+
Classifier: License :: Other/Proprietary License
|
|
16
17
|
Classifier: Operating System :: OS Independent
|
|
17
18
|
Classifier: Programming Language :: Python
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
25
|
Classifier: Topic :: Utilities
|
|
19
|
-
Requires-Python: >=3.6
|
|
20
|
-
Description-Content-Type: text/x-rst
|
|
21
|
-
Provides-Extra: sphinx
|
|
22
|
-
Provides-Extra: websocket
|
|
23
26
|
Provides-Extra: requests
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
Provides-Extra: websocket
|
|
28
|
+
Requires-Dist: graphql-core (>=3.2.4,<4.0.0)
|
|
29
|
+
Requires-Dist: requests ; extra == "requests"
|
|
30
|
+
Requires-Dist: websocket-client ; extra == "websocket"
|
|
31
|
+
Project-URL: Documentation, https://sgqlc.readthedocs.io/
|
|
32
|
+
Project-URL: Repository, http://github.com/profusion/sgqlc
|
|
33
|
+
Description-Content-Type: text/x-rst
|
|
26
34
|
|
|
27
35
|
`sgqlc` - Simple GraphQL Client
|
|
28
36
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
@@ -39,18 +47,18 @@ Introduction
|
|
|
39
47
|
This package offers an easy to use `GraphQL <http://graphql.org>`_
|
|
40
48
|
client. It's composed of the following modules:
|
|
41
49
|
|
|
42
|
-
-
|
|
43
|
-
interpret queries. Submodule
|
|
44
|
-
provide bindings for
|
|
45
|
-
|
|
50
|
+
- ``sgqlc.types``: declare GraphQL in Python, base to generate and
|
|
51
|
+
interpret queries. Submodule ``sgqlc.types.datetime`` will
|
|
52
|
+
provide bindings for ``datetime`` and ISO 8601, while
|
|
53
|
+
``sgqlc.types.relay`` will expose ``Node``, ``PageInfo`` and
|
|
46
54
|
``Connection``.
|
|
47
55
|
|
|
48
|
-
-
|
|
56
|
+
- ``sgqlc.operation``: use declared types to generate and
|
|
49
57
|
interpret queries.
|
|
50
58
|
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
- ``sgqlc.endpoint``: provide access to GraphQL endpoints, notably
|
|
60
|
+
``sgqlc.endpoint.http`` provides ``HTTPEndpoint`` using
|
|
61
|
+
``urllib.request.urlopen()``.
|
|
54
62
|
|
|
55
63
|
|
|
56
64
|
What's GraphQL?
|
|
@@ -208,8 +216,8 @@ interpret the results. So **what was the rationale to create sgqlc?**
|
|
|
208
216
|
types, such as ``Date``, ``Time`` and ``DateTime``. Often these are
|
|
209
217
|
serialized as ISO 8601 strings and the user must parse them in their
|
|
210
218
|
application. We offer ``sgqlc.types.datetime`` to automatically
|
|
211
|
-
generate
|
|
212
|
-
|
|
219
|
+
generate ``datetime.date``, ``datetime.time`` and
|
|
220
|
+
``datetime.datetime``.
|
|
213
221
|
|
|
214
222
|
- Make it easy to write dynamic queries, including nested. As seen,
|
|
215
223
|
GraphQL can be used to fetch lots of information in one go; however
|
|
@@ -220,7 +228,7 @@ interpret the results. So **what was the rationale to create sgqlc?**
|
|
|
220
228
|
"solve" this by parsing the query locally before sending it to
|
|
221
229
|
server. However usually the indentation is screwed and reviewing it
|
|
222
230
|
is painful. We change that approach: use
|
|
223
|
-
|
|
231
|
+
``sgqlc.operation.Operation`` and it will always generate valid
|
|
224
232
|
queries, which can be printed out and properly indented. Bonus point
|
|
225
233
|
is that it can be used to later interpret the JSON results into native
|
|
226
234
|
Python objects.
|
|
@@ -231,11 +239,11 @@ interpret the results. So **what was the rationale to create sgqlc?**
|
|
|
231
239
|
and its widely used. To load more data, you need to extend the
|
|
232
240
|
previous data with newly fetched information, updating not only the
|
|
233
241
|
nodes and edges, but also page information. This is done
|
|
234
|
-
automatically by
|
|
242
|
+
automatically by ``sgqlc.types.relay.Connection``.
|
|
235
243
|
|
|
236
244
|
It also helps with code-generation, ``sgqlc-codegen`` can generate both
|
|
237
245
|
the classes matching a GraphQL Schema or functions to return
|
|
238
|
-
|
|
246
|
+
``sgqlc.operation.Operation`` based on executable documents
|
|
239
247
|
GraphQL Domain Specific Language (DSL).
|
|
240
248
|
|
|
241
249
|
|
|
@@ -275,7 +283,7 @@ However, writing GraphQL queries and later interpreting the results
|
|
|
275
283
|
may be cumbersome. That's solved by our ``sgqlc.types``, which is
|
|
276
284
|
usually paired with ``sgqlc.operation`` to generate queries and then
|
|
277
285
|
interpret results (see more at ``examples/basic/02_schema_types.py``). The
|
|
278
|
-
example below matches a subset of
|
|
286
|
+
example below matches a subset of
|
|
279
287
|
`GitHub API v4 <https://developer.github.com/v4/query/>`_.
|
|
280
288
|
In GraphQL syntax it would be::
|
|
281
289
|
|
|
@@ -410,7 +418,7 @@ introspection call:
|
|
|
410
418
|
user@host$ sgqlc-codegen schema github_schema.json github_schema.py
|
|
411
419
|
|
|
412
420
|
This generates ``github_schema`` that provides the
|
|
413
|
-
|
|
421
|
+
``sgqlc.types.Schema`` instance of the same name ``github_schema``.
|
|
414
422
|
Then it's a matter of using that in your Python code, as in the example below
|
|
415
423
|
from ``examples/github/github_agile_dashboard.py``:
|
|
416
424
|
|
|
@@ -449,7 +457,7 @@ You can also generate these operations given a GraphQL Domain Specific
|
|
|
449
457
|
Language (DSL) operation:
|
|
450
458
|
|
|
451
459
|
.. code-block::
|
|
452
|
-
|
|
460
|
+
|
|
453
461
|
# sample_operations.gql
|
|
454
462
|
|
|
455
463
|
query ListIssues($owner: String!, $name: String!) {
|
|
@@ -510,34 +518,33 @@ License
|
|
|
510
518
|
Getting started developing
|
|
511
519
|
--------------------------
|
|
512
520
|
|
|
513
|
-
You need to use `
|
|
521
|
+
You need to use `poetry <https://python-poetry.org/docs/#installation>`_.
|
|
514
522
|
|
|
515
523
|
::
|
|
516
524
|
|
|
517
|
-
|
|
518
|
-
|
|
525
|
+
poetry install --all-extras --with dev
|
|
526
|
+
poetry shell
|
|
519
527
|
|
|
520
|
-
Install the
|
|
528
|
+
Install the `pre-commit <https://pre-commit.com/index.html#install>`_:
|
|
521
529
|
|
|
522
530
|
::
|
|
523
531
|
|
|
524
|
-
|
|
532
|
+
pre-commit install -f
|
|
525
533
|
|
|
526
534
|
Run the tests (one of the below):
|
|
527
535
|
|
|
528
536
|
::
|
|
529
537
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
flake8 --config setup.cfg . # style checks
|
|
538
|
+
pre-commit run -a # run all tests: flake8, pytest, ...
|
|
539
|
+
pre-commit run -a flake8 # run only flake8
|
|
540
|
+
pre-commit run -a tests # run only pytest (unit tests)
|
|
534
541
|
|
|
535
542
|
Keep 100% coverage. You can look at the coverage report at
|
|
536
|
-
``cover/index.html``. To do that, prefer
|
|
537
|
-
`doctest <https://docs.python.org/3.
|
|
543
|
+
``cover/index.html``. To do that, prefer
|
|
544
|
+
`doctest <https://docs.python.org/3.12/library/doctest.html>`_
|
|
538
545
|
so it serves as
|
|
539
|
-
both documentation and test. However we use
|
|
540
|
-
`
|
|
546
|
+
both documentation and test. However we use
|
|
547
|
+
`pytest <https://docs.pytest.org/>`_ to write explicit tests that would be
|
|
541
548
|
hard to express using ``doctest``.
|
|
542
549
|
|
|
543
550
|
Build and review the generated Sphinx documentation, and validate if your
|
|
@@ -545,7 +552,7 @@ changes look right:
|
|
|
545
552
|
|
|
546
553
|
::
|
|
547
554
|
|
|
548
|
-
|
|
555
|
+
sphinx-build doc/source doc/build
|
|
549
556
|
open doc/build/html/index.html
|
|
550
557
|
|
|
551
558
|
|
|
@@ -559,3 +566,4 @@ Public Schemas
|
|
|
559
566
|
The following repositories provides public schemas generated using ``sgqlc-codegen``:
|
|
560
567
|
|
|
561
568
|
- `Mogost/sgqlc-schemas <https://github.com/Mogost/sgqlc-schemas>`_ GitHub, Monday.com
|
|
569
|
+
|
|
@@ -13,18 +13,18 @@ Introduction
|
|
|
13
13
|
This package offers an easy to use `GraphQL <http://graphql.org>`_
|
|
14
14
|
client. It's composed of the following modules:
|
|
15
15
|
|
|
16
|
-
-
|
|
17
|
-
interpret queries. Submodule
|
|
18
|
-
provide bindings for
|
|
19
|
-
|
|
16
|
+
- ``sgqlc.types``: declare GraphQL in Python, base to generate and
|
|
17
|
+
interpret queries. Submodule ``sgqlc.types.datetime`` will
|
|
18
|
+
provide bindings for ``datetime`` and ISO 8601, while
|
|
19
|
+
``sgqlc.types.relay`` will expose ``Node``, ``PageInfo`` and
|
|
20
20
|
``Connection``.
|
|
21
21
|
|
|
22
|
-
-
|
|
22
|
+
- ``sgqlc.operation``: use declared types to generate and
|
|
23
23
|
interpret queries.
|
|
24
24
|
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
- ``sgqlc.endpoint``: provide access to GraphQL endpoints, notably
|
|
26
|
+
``sgqlc.endpoint.http`` provides ``HTTPEndpoint`` using
|
|
27
|
+
``urllib.request.urlopen()``.
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
What's GraphQL?
|
|
@@ -182,8 +182,8 @@ interpret the results. So **what was the rationale to create sgqlc?**
|
|
|
182
182
|
types, such as ``Date``, ``Time`` and ``DateTime``. Often these are
|
|
183
183
|
serialized as ISO 8601 strings and the user must parse them in their
|
|
184
184
|
application. We offer ``sgqlc.types.datetime`` to automatically
|
|
185
|
-
generate
|
|
186
|
-
|
|
185
|
+
generate ``datetime.date``, ``datetime.time`` and
|
|
186
|
+
``datetime.datetime``.
|
|
187
187
|
|
|
188
188
|
- Make it easy to write dynamic queries, including nested. As seen,
|
|
189
189
|
GraphQL can be used to fetch lots of information in one go; however
|
|
@@ -194,7 +194,7 @@ interpret the results. So **what was the rationale to create sgqlc?**
|
|
|
194
194
|
"solve" this by parsing the query locally before sending it to
|
|
195
195
|
server. However usually the indentation is screwed and reviewing it
|
|
196
196
|
is painful. We change that approach: use
|
|
197
|
-
|
|
197
|
+
``sgqlc.operation.Operation`` and it will always generate valid
|
|
198
198
|
queries, which can be printed out and properly indented. Bonus point
|
|
199
199
|
is that it can be used to later interpret the JSON results into native
|
|
200
200
|
Python objects.
|
|
@@ -205,11 +205,11 @@ interpret the results. So **what was the rationale to create sgqlc?**
|
|
|
205
205
|
and its widely used. To load more data, you need to extend the
|
|
206
206
|
previous data with newly fetched information, updating not only the
|
|
207
207
|
nodes and edges, but also page information. This is done
|
|
208
|
-
automatically by
|
|
208
|
+
automatically by ``sgqlc.types.relay.Connection``.
|
|
209
209
|
|
|
210
210
|
It also helps with code-generation, ``sgqlc-codegen`` can generate both
|
|
211
211
|
the classes matching a GraphQL Schema or functions to return
|
|
212
|
-
|
|
212
|
+
``sgqlc.operation.Operation`` based on executable documents
|
|
213
213
|
GraphQL Domain Specific Language (DSL).
|
|
214
214
|
|
|
215
215
|
|
|
@@ -249,7 +249,7 @@ However, writing GraphQL queries and later interpreting the results
|
|
|
249
249
|
may be cumbersome. That's solved by our ``sgqlc.types``, which is
|
|
250
250
|
usually paired with ``sgqlc.operation`` to generate queries and then
|
|
251
251
|
interpret results (see more at ``examples/basic/02_schema_types.py``). The
|
|
252
|
-
example below matches a subset of
|
|
252
|
+
example below matches a subset of
|
|
253
253
|
`GitHub API v4 <https://developer.github.com/v4/query/>`_.
|
|
254
254
|
In GraphQL syntax it would be::
|
|
255
255
|
|
|
@@ -384,7 +384,7 @@ introspection call:
|
|
|
384
384
|
user@host$ sgqlc-codegen schema github_schema.json github_schema.py
|
|
385
385
|
|
|
386
386
|
This generates ``github_schema`` that provides the
|
|
387
|
-
|
|
387
|
+
``sgqlc.types.Schema`` instance of the same name ``github_schema``.
|
|
388
388
|
Then it's a matter of using that in your Python code, as in the example below
|
|
389
389
|
from ``examples/github/github_agile_dashboard.py``:
|
|
390
390
|
|
|
@@ -423,7 +423,7 @@ You can also generate these operations given a GraphQL Domain Specific
|
|
|
423
423
|
Language (DSL) operation:
|
|
424
424
|
|
|
425
425
|
.. code-block::
|
|
426
|
-
|
|
426
|
+
|
|
427
427
|
# sample_operations.gql
|
|
428
428
|
|
|
429
429
|
query ListIssues($owner: String!, $name: String!) {
|
|
@@ -484,34 +484,33 @@ License
|
|
|
484
484
|
Getting started developing
|
|
485
485
|
--------------------------
|
|
486
486
|
|
|
487
|
-
You need to use `
|
|
487
|
+
You need to use `poetry <https://python-poetry.org/docs/#installation>`_.
|
|
488
488
|
|
|
489
489
|
::
|
|
490
490
|
|
|
491
|
-
|
|
492
|
-
|
|
491
|
+
poetry install --all-extras --with dev
|
|
492
|
+
poetry shell
|
|
493
493
|
|
|
494
|
-
Install the
|
|
494
|
+
Install the `pre-commit <https://pre-commit.com/index.html#install>`_:
|
|
495
495
|
|
|
496
496
|
::
|
|
497
497
|
|
|
498
|
-
|
|
498
|
+
pre-commit install -f
|
|
499
499
|
|
|
500
500
|
Run the tests (one of the below):
|
|
501
501
|
|
|
502
502
|
::
|
|
503
503
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
flake8 --config setup.cfg . # style checks
|
|
504
|
+
pre-commit run -a # run all tests: flake8, pytest, ...
|
|
505
|
+
pre-commit run -a flake8 # run only flake8
|
|
506
|
+
pre-commit run -a tests # run only pytest (unit tests)
|
|
508
507
|
|
|
509
508
|
Keep 100% coverage. You can look at the coverage report at
|
|
510
|
-
``cover/index.html``. To do that, prefer
|
|
511
|
-
`doctest <https://docs.python.org/3.
|
|
509
|
+
``cover/index.html``. To do that, prefer
|
|
510
|
+
`doctest <https://docs.python.org/3.12/library/doctest.html>`_
|
|
512
511
|
so it serves as
|
|
513
|
-
both documentation and test. However we use
|
|
514
|
-
`
|
|
512
|
+
both documentation and test. However we use
|
|
513
|
+
`pytest <https://docs.pytest.org/>`_ to write explicit tests that would be
|
|
515
514
|
hard to express using ``doctest``.
|
|
516
515
|
|
|
517
516
|
Build and review the generated Sphinx documentation, and validate if your
|
|
@@ -519,7 +518,7 @@ changes look right:
|
|
|
519
518
|
|
|
520
519
|
::
|
|
521
520
|
|
|
522
|
-
|
|
521
|
+
sphinx-build doc/source doc/build
|
|
523
522
|
open doc/build/html/index.html
|
|
524
523
|
|
|
525
524
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
1
|
# -*- coding: utf-8 -*-
|
|
3
2
|
#
|
|
4
3
|
# This file is execfile()d with the current directory set to its
|
|
@@ -62,16 +61,16 @@ author = 'ProFUSION Sistemas e Solucoes LTDA'
|
|
|
62
61
|
# built documents.
|
|
63
62
|
#
|
|
64
63
|
# The short X.Y version.
|
|
65
|
-
version = '
|
|
64
|
+
version = '16.4'
|
|
66
65
|
# The full version, including alpha/beta/rc tags.
|
|
67
|
-
release = '
|
|
66
|
+
release = '16.4'
|
|
68
67
|
|
|
69
68
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
70
69
|
# for a list of supported languages.
|
|
71
70
|
#
|
|
72
71
|
# This is also used if you do content translation via gettext catalogs.
|
|
73
72
|
# Usually you set "language" from the command line for these cases.
|
|
74
|
-
language =
|
|
73
|
+
language = 'en'
|
|
75
74
|
|
|
76
75
|
# List of patterns, relative to source directory, that match files and
|
|
77
76
|
# directories to ignore when looking for source files.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
[tool.black]
|
|
2
|
+
line-length = 79
|
|
3
|
+
skip-string-normalization = true
|
|
4
|
+
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
|
|
5
|
+
force-exclude = '/(doc/|examples/.*(schema|operations)[.]py)'
|
|
6
|
+
|
|
7
|
+
[tool.pytest.ini_options]
|
|
8
|
+
addopts = '--import-mode=importlib --doctest-modules --cov=sgqlc --cov-fail-under=100 --cov-report=term-missing --cov-report=xml --cov-report=html:cover'
|
|
9
|
+
python_files = ['test-*.py', 'test_*.py']
|
|
10
|
+
testpaths = [
|
|
11
|
+
'sgqlc',
|
|
12
|
+
'tests',
|
|
13
|
+
]
|
|
14
|
+
norecursedirs = [
|
|
15
|
+
'.eggs',
|
|
16
|
+
'.git',
|
|
17
|
+
'.github',
|
|
18
|
+
'.venv',
|
|
19
|
+
'*.egg-info',
|
|
20
|
+
'build',
|
|
21
|
+
'cover',
|
|
22
|
+
'dist',
|
|
23
|
+
'doc',
|
|
24
|
+
'examples',
|
|
25
|
+
'utils',
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[tool.poetry]
|
|
29
|
+
name = 'sgqlc'
|
|
30
|
+
version = '16.4'
|
|
31
|
+
description = 'Simple GraphQL Client'
|
|
32
|
+
readme = 'README.rst'
|
|
33
|
+
authors = [
|
|
34
|
+
'Gustavo Sverzut Barbieri <barbieri@profusion.mobi>',
|
|
35
|
+
]
|
|
36
|
+
homepage = 'http://github.com/profusion/sgqlc'
|
|
37
|
+
repository = 'http://github.com/profusion/sgqlc'
|
|
38
|
+
documentation = 'https://sgqlc.readthedocs.io/'
|
|
39
|
+
license = 'ISCL'
|
|
40
|
+
keywords = ['graphql', 'client', 'http', 'endpoint']
|
|
41
|
+
classifiers=[
|
|
42
|
+
'Development Status :: 4 - Beta',
|
|
43
|
+
'Environment :: Console',
|
|
44
|
+
'Environment :: Web Environment',
|
|
45
|
+
'Intended Audience :: Developers',
|
|
46
|
+
'License :: OSI Approved :: ISC License (ISCL)',
|
|
47
|
+
'Operating System :: OS Independent',
|
|
48
|
+
'Programming Language :: Python',
|
|
49
|
+
'Topic :: Utilities',
|
|
50
|
+
]
|
|
51
|
+
packages = [{ include = 'sgqlc' }]
|
|
52
|
+
include = [
|
|
53
|
+
{ path = 'AUTHORS', format = 'sdist' },
|
|
54
|
+
{ path = 'doc/source', format = 'sdist' },
|
|
55
|
+
{ path = 'tests', format = 'sdist' },
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
[tool.poetry.scripts]
|
|
59
|
+
sgqlc-codegen = 'sgqlc.codegen:main'
|
|
60
|
+
|
|
61
|
+
[tool.poetry.dependencies]
|
|
62
|
+
# <3.13 is to enable coveralls 4, which requires python >=3.8,<3.13
|
|
63
|
+
python = '>=3.8,<3.13'
|
|
64
|
+
graphql-core = '^3.2.4'
|
|
65
|
+
websocket-client = { version = '*', optional = true }
|
|
66
|
+
requests = { version = '*', optional = true }
|
|
67
|
+
|
|
68
|
+
[tool.poetry.extras]
|
|
69
|
+
websocket = ['websocket-client']
|
|
70
|
+
requests = ['requests']
|
|
71
|
+
|
|
72
|
+
[tool.poetry.group.dev.dependencies]
|
|
73
|
+
coveralls = '*'
|
|
74
|
+
pytest = '*'
|
|
75
|
+
pytest-cov = '*'
|
|
76
|
+
sphinx = '*'
|
|
77
|
+
sphinx-argparse = '*'
|
|
78
|
+
|
|
79
|
+
[tool.poetry.group.docs.dependencies]
|
|
80
|
+
sphinx = '*'
|
|
81
|
+
sphinx-argparse = '*'
|
|
82
|
+
|
|
83
|
+
[build-system]
|
|
84
|
+
requires = ['poetry-core']
|
|
85
|
+
build-backend = 'poetry.core.masonry.api'
|
|
@@ -118,13 +118,19 @@ def main():
|
|
|
118
118
|
continue
|
|
119
119
|
elif arg not in subcommands:
|
|
120
120
|
raw_args.insert(i, 'schema')
|
|
121
|
-
sys.stderr.writelines(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
sys.stderr.writelines(
|
|
122
|
+
(
|
|
123
|
+
'WARNING: ',
|
|
124
|
+
sys.argv[0],
|
|
125
|
+
' now requires a "command" specifier. Assuming "schema". '
|
|
126
|
+
'Please update your usage as this automatic conversion '
|
|
127
|
+
'will be removed in the future!\n',
|
|
128
|
+
)
|
|
129
|
+
)
|
|
127
130
|
break
|
|
128
131
|
|
|
129
132
|
args = ap.parse_args(raw_args)
|
|
133
|
+
if 'func' not in args:
|
|
134
|
+
ap.error('missing command')
|
|
135
|
+
|
|
130
136
|
args.func(args)
|