Skip to content

Chore update graphql core to 3.3.0 and dropping support for Python 3.6 #363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Build wheel and source tarball
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,22 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "pypy3"]
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy3.8"]
os: [ubuntu-latest, windows-latest]
exclude:
- os: windows-latest
python-version: "3.6"
- os: windows-latest
python-version: "3.7"
- os: windows-latest
python-version: "3.9"
- os: windows-latest
python-version: "3.10"
- os: windows-latest
python-version: "pypy3"
python-version: "pypy3.8"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -45,9 +43,9 @@ jobs:
dependency: ["aiohttp", "requests", "websockets"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies with only ${{ matrix.dependency }} extra dependency
Expand All @@ -61,9 +59,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install test dependencies
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GQL

This is a GraphQL client for Python 3.6+.
This is a GraphQL client for Python 3.7+.
Plays nicely with `graphene`, `graphql-core`, `graphql-js` and any other GraphQL implementation compatible with the spec.

GQL architecture is inspired by `React-Relay` and `Apollo-Client`.
Expand Down
2 changes: 1 addition & 1 deletion docs/gql-cli/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
gql-cli
=======

GQL provides a python 3.6+ script, called `gql-cli` which allows you to execute
GQL provides a python 3.7+ script, called `gql-cli` which allows you to execute
GraphQL queries directly from the terminal.

This script supports http(s) or websockets protocols.
Expand Down
2 changes: 1 addition & 1 deletion docs/intro.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Introduction
============

`GQL 3`_ is a `GraphQL`_ Client for Python 3.6+ which plays nicely with other
`GQL 3`_ is a `GraphQL`_ Client for Python 3.7+ which plays nicely with other
graphql implementations compatible with the spec.

Under the hood, it uses `GraphQL-core`_ which is a Python port of `GraphQL.js`_,
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import setup, find_packages

install_requires = [
"graphql-core>=3.2,<3.3",
"graphql-core>=3.3.0a2,<3.4",
"yarl>=1.6,<2.0",
"backoff>=1.11.1,<3.0",
]
Expand Down Expand Up @@ -48,8 +48,7 @@
]

install_websockets_requires = [
"websockets>=9,<10;python_version<='3.6'",
"websockets>=10,<11;python_version>'3.6'",
"websockets>=10,<11",
]

install_botocore_requires = [
Expand Down Expand Up @@ -82,7 +81,6 @@
"Topic :: Software Development :: Libraries",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand Down
4 changes: 2 additions & 2 deletions tests/custom_scalars/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def test_json_value_input_in_dsl_argument():
assert (
str(query)
== """addPlayer(
player: {name: "Tim", level: 0, is_connected: false, score: 5, friends: ["Lea"]}
player: { name: "Tim", level: 0, is_connected: false, score: 5, friends: ["Lea"] }
)"""
)

Expand Down Expand Up @@ -237,6 +237,6 @@ def test_json_value_input_with_none_list_in_dsl_argument():
assert (
str(query)
== """addPlayer(
player: {name: "Bob", level: 9001, is_connected: true, score: 666.66, friends: null}
player: { name: "Bob", level: 9001, is_connected: true, score: 666.66, friends: null }
)"""
)
6 changes: 3 additions & 3 deletions tests/starwars/test_dsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def test_add_variable_definitions_with_default_value_input_object(ds):
assert (
print_ast(query)
== """
mutation ($review: ReviewInput = {stars: 5, commentary: "Wow!"}, $episode: Episode) {
mutation ($review: ReviewInput = { stars: 5, commentary: "Wow!" }, $episode: Episode) {
createReview(review: $review, episode: $episode) {
stars
commentary
Expand All @@ -229,7 +229,7 @@ def test_add_variable_definitions_in_input_object(ds):
print_ast(query)
== """mutation ($stars: Int, $commentary: String, $episode: Episode) {
createReview(
review: {stars: $stars, commentary: $commentary}
review: { stars: $stars, commentary: $commentary }
episode: $episode
) {
stars
Expand Down Expand Up @@ -554,7 +554,7 @@ def test_multiple_operations(ds):
mutation CreateReviewMutation {
createReview(
episode: JEDI
review: {stars: 5, commentary: "This is a great movie!"}
review: { stars: 5, commentary: "This is a great movie!" }
) {
stars
commentary
Expand Down
13 changes: 7 additions & 6 deletions tests/test_aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,15 +588,15 @@ def test_code():

file_upload_mutation_1 = """
mutation($file: Upload!) {
uploadFile(input:{other_var:$other_var, file:$file}) {
uploadFile(input:{ other_var:$other_var, file:$file }) {
success
}
}
"""

file_upload_mutation_1_operations = (
'{"query": "mutation ($file: Upload!) {\\n uploadFile(input: {other_var: '
'$other_var, file: $file}) {\\n success\\n }\\n}", "variables": '
'{"query": "mutation ($file: Upload!) {\\n uploadFile(input: { other_var: '
'$other_var, file: $file }) {\\n success\\n }\\n}", "variables": '
'{"file": null, "other_var": 42}}'
)

Expand Down Expand Up @@ -863,7 +863,7 @@ async def file_sender(file_name):

file_upload_mutation_2_operations = (
'{"query": "mutation ($file1: Upload!, $file2: Upload!) {\\n '
'uploadFile(input: {file1: $file, file2: $file}) {\\n success\\n }\\n}", '
'uploadFile(input: { file1: $file, file2: $file }) {\\n success\\n }\\n}", '
'"variables": {"file1": null, "file2": null}}'
)

Expand Down Expand Up @@ -951,14 +951,15 @@ async def handler(request):

file_upload_mutation_3 = """
mutation($files: [Upload!]!) {
uploadFiles(input:{files:$files}) {
uploadFiles(input:{ files:$files }) {
success
}
}
"""

file_upload_mutation_3_operations = (
'{"query": "mutation ($files: [Upload!]!) {\\n uploadFiles(input: {files: $files})'
'{"query": "mutation ($files: [Upload!]!) {\\n uploadFiles('
"input: { files: $files })"
' {\\n success\\n }\\n}", "variables": {"files": [null, null]}}'
)

Expand Down
11 changes: 6 additions & 5 deletions tests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,15 @@ def test_code():

file_upload_mutation_1 = """
mutation($file: Upload!) {
uploadFile(input:{other_var:$other_var, file:$file}) {
uploadFile(input:{ other_var:$other_var, file:$file }) {
success
}
}
"""

file_upload_mutation_1_operations = (
'{"query": "mutation ($file: Upload!) {\\n uploadFile(input: {other_var: '
'$other_var, file: $file}) {\\n success\\n }\\n}", "variables": '
'{"query": "mutation ($file: Upload!) {\\n uploadFile(input: { other_var: '
'$other_var, file: $file }) {\\n success\\n }\\n}", "variables": '
'{"file": null, "other_var": 42}}'
)

Expand Down Expand Up @@ -611,7 +611,7 @@ def test_code():

file_upload_mutation_2_operations = (
'{"query": "mutation ($file1: Upload!, $file2: Upload!) {\\n '
'uploadFile(input: {file1: $file, file2: $file}) {\\n success\\n }\\n}", '
'uploadFile(input: { file1: $file, file2: $file }) {\\n success\\n }\\n}", '
'"variables": {"file1": null, "file2": null}}'
)

Expand Down Expand Up @@ -710,7 +710,8 @@ def test_code():


file_upload_mutation_3_operations = (
'{"query": "mutation ($files: [Upload!]!) {\\n uploadFiles(input: {files: $files})'
'{"query": "mutation ($files: [Upload!]!) {\\n uploadFiles'
"(input: { files: $files })"
' {\\n success\\n }\\n}", "variables": {"files": [null, null]}}'
)

Expand Down
7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
[tox]
envlist =
black,flake8,import-order,mypy,manifest,
py{36,37,38,39,310,py3}
py{37,38,39,310,py3}

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
pypy3: pypy3
pypy-3: pypy3

[testenv]
conda_channels = conda-forge
Expand All @@ -28,7 +27,7 @@ deps = -e.[test]
commands =
pip install -U setuptools
; run "tox -- tests -s" to show output for debugging
py{36,37,39,310,py3}: pytest {posargs:tests}
py{37,39,310,py3}: pytest {posargs:tests}
py{38}: pytest {posargs:tests --cov-report=term-missing --cov=gql}

[testenv:black]
Expand Down