Skip to content

Commit c758825

Browse files
authored
Merge pull request #32 from qlient-org/develop
BREAKING CHANGE: Release 1.0.0
2 parents ff25d7b + 6eb0d7f commit c758825

File tree

100 files changed

+1246
-12020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1246
-12020
lines changed

.circleci/config.yml

Lines changed: 0 additions & 104 deletions
This file was deleted.

.deepsource.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
version = 1
22

33
test_patterns = ["tests/**"]
4+
exclude_patterns = ["docs/**", "site/**"]
45

56
[[analyzers]]
67
name = "python"
78
enabled = true
89

910
[analyzers.meta]
10-
max_line_length = 120
1111
runtime_version = "3.x.x"
12+
13+
[[transformers]]
14+
name = "black"
15+
enabled = true

.github/workflows/docs.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Qlient HTTP Requests - Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build_and_push:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: "3.9"
17+
- name: Set up Poetry
18+
uses: abatilo/[email protected]
19+
with:
20+
poetry-version: 1.1.13
21+
- name: Install dependencies
22+
run: poetry install
23+
- name: Build And Commit Site
24+
run: |
25+
poetry run mkdocs build
26+
git config user.name github-actions
27+
git config user.email [email protected]
28+
git add site
29+
git commit -m "ci: build and commit documentation"
30+
git push

.github/workflows/publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Qlient HTTP Requests - Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build_and_publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up Python
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: "3.9"
16+
- name: Set up Poetry
17+
uses: abatilo/[email protected]
18+
with:
19+
poetry-version: 1.1.13
20+
- name: Install dependencies
21+
run: poetry install
22+
- name: Publish
23+
run: poetry publish --build --username "${{secrets.PYPI_USERNAME}}" --password "${{secrets.PYPI_PASSWORD}}" --no-interaction

.github/workflows/pytest.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Qlient HTTP Requests - Pytest
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
python-version: ["3.7", "3.8", "3.9", "3.10"]
12+
poetry-version: ["1.1.13"]
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Set up Poetry ${{ matrix.poetry-version }}
24+
uses: abatilo/[email protected]
25+
with:
26+
poetry-version: ${{ matrix.poetry-version }}
27+
- name: Install dependencies
28+
run: poetry install
29+
- name: Run Pytest
30+
run: poetry run pytest --cov=src --cov-report=xml

.gitignore

Lines changed: 82 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,82 @@
1-
/venv/
2-
/env/
3-
/virtualenv/
4-
/.idea/
5-
/build/
6-
/dist/
7-
/.pytest_cache/**
8-
/*.egg-info/
9-
.install.stamp
10-
.coverage
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# IPython
55+
profile_default/
56+
ipython_config.py
57+
58+
59+
# poetry
60+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
61+
# This is especially recommended for binary packages to ensure reproducibility, and is more
62+
# commonly ignored for libraries.
63+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
64+
#poetry.lock
65+
66+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
67+
__pypackages__/
68+
69+
70+
# Environments
71+
.env
72+
.venv
73+
env/
74+
venv/
75+
ENV/
76+
env.bak/
77+
venv.bak/
78+
79+
.idea/
80+
81+
# install stamp
82+
.install.stamp

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ clean:
3030

3131
.PHONY: test
3232
test: $(INSTALL_STAMP)
33-
$(POETRY) run coverage run -m pytest
33+
$(POETRY) run pytest --cov=src
3434

3535

3636
.PHONY: report

README.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,45 @@
11
# Qlient: Python GraphQL Client
22

3-
[![qlient-org](https://circleci.com/gh/qlient-org/python-qlient.svg?style=svg)](https://circleci.com/gh/qlient-org/python-qlient)
4-
[![DeepSource](https://deepsource.io/gh/qlient-org/python-qlient.svg/?label=resolved+issues&token=WQWScZui5Jy-cNg3fzvWxqhW)](https://deepsource.io/gh/qlient-org/python-qlient/?ref=repository-badge)
3+
[![DeepSource](https://deepsource.io/gh/qlient-org/python-qlient.svg/?label=active+issues&token=2ZJ0b1dinekjVtwgJHSy286C)](https://deepsource.io/gh/qlient-org/python-qlient/?ref=repository-badge)
4+
[![DeepSource](https://deepsource.io/gh/qlient-org/python-qlient.svg/?label=resolved+issues&token=2ZJ0b1dinekjVtwgJHSy286C)](https://deepsource.io/gh/qlient-org/python-qlient/?ref=repository-badge)
55
[![pypi](https://img.shields.io/pypi/v/qlient.svg)](https://pypi.python.org/pypi/qlient)
66
[![versions](https://img.shields.io/pypi/pyversions/qlient.svg)](https://github.com/qlient-org/python-qlient)
77
[![license](https://img.shields.io/github/license/qlient-org/python-qlient.svg)](https://github.com/qlient-org/python-qlient/blob/master/LICENSE)
8+
[![codestyle](https://img.shields.io/badge/code%20style-black-black)](https://github.com/psf/black)
89

910
A fast and modern graphql client designed with simplicity in mind.
1011

12+
## Key Features
13+
14+
* Compatible with Python 3.7 and above
15+
* Build on top of
16+
[qlient-core](https://github.com/qlient-org/python-qlient-core),
17+
[requests](https://github.com/psf/requests)
18+
and [websocket-client](https://github.com/websocket-client/websocket-client/)
19+
* support for subscriptions
20+
1121
## Help
1222

13-
See [documentation](https://qlient-org.github.io/python-qlient/) for more details
23+
See [documentation](https://qlient-org.github.io/python-qlient/) for more details.
24+
25+
If you want more information about the internals,
26+
I kindly refer you to the [qlient-core documentation](https://qlient-org.github.io/python-qlient-core/).
27+
28+
If you are looking for an asynchronous implementation,
29+
I kindly refer you to the [qlient-aiohttp](https://github.com/qlient-org/python-qlient-aiohttp) sister project.
1430

1531
## Installation
1632

17-
```shell script
33+
```shell
1834
pip install qlient
1935
```
2036

2137
## Quick Start
2238

2339
````python
24-
from qlient import Client, GraphQLResponse
40+
from qlient.http import HTTPClient, GraphQLResponse
2541

26-
client = Client("https://swapi-graphql.netlify.app/.netlify/functions/index")
42+
client = HTTPClient("https://swapi-graphql.netlify.app/.netlify/functions/index")
2743

2844
res: GraphQLResponse = client.query.film(
2945
# swapi graphql input fields
@@ -33,7 +49,7 @@ res: GraphQLResponse = client.query.film(
3349
_fields=["id", "title", "episodeID"]
3450
)
3551

36-
print(res.query) # query film($id: ID) { film(id: $id) { id title episodeID } }
37-
print(res.variables) # {'id': 'ZmlsbXM6MQ=='}
52+
print(res.request.query) # query film($id: ID) { film(id: $id) { id title episodeID } }
53+
print(res.request.variables) # {'id': 'ZmlsbXM6MQ=='}
3854
print(res.data) # {'film': {'id': 'ZmlsbXM6MQ==', 'title': 'A New Hope', 'episodeID': 4}}
3955
````

0 commit comments

Comments
 (0)