From bcc8bb0de7ef177b1cba70ad40f4a0c4eeb56327 Mon Sep 17 00:00:00 2001 From: Hanusz Leszek Date: Sun, 25 Sep 2022 00:15:57 +0200 Subject: [PATCH 01/10] Adding spaces inside input object in tests --- tests/custom_scalars/test_json.py | 4 ++-- tests/starwars/test_dsl.py | 6 +++--- tests/test_aiohttp.py | 12 ++++++------ tests/test_requests.py | 10 +++++----- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/custom_scalars/test_json.py b/tests/custom_scalars/test_json.py index 4c4da588..6276b408 100644 --- a/tests/custom_scalars/test_json.py +++ b/tests/custom_scalars/test_json.py @@ -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"] } )""" ) @@ -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 } )""" ) diff --git a/tests/starwars/test_dsl.py b/tests/starwars/test_dsl.py index d021e122..714e713a 100644 --- a/tests/starwars/test_dsl.py +++ b/tests/starwars/test_dsl.py @@ -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 @@ -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 @@ -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 diff --git a/tests/test_aiohttp.py b/tests/test_aiohttp.py index f1a3cdf5..632f4f23 100644 --- a/tests/test_aiohttp.py +++ b/tests/test_aiohttp.py @@ -535,15 +535,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}}' ) @@ -810,7 +810,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}}' ) @@ -898,14 +898,14 @@ 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]}}' ) diff --git a/tests/test_requests.py b/tests/test_requests.py index 70fc337e..b7044a71 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -350,15 +350,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}}' ) @@ -562,7 +562,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}}' ) @@ -661,7 +661,7 @@ 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]}}' ) From a6a82419c3e30f521b2b6d06c8b970bbd614429f Mon Sep 17 00:00:00 2001 From: Hanusz Leszek Date: Sun, 25 Sep 2022 00:20:29 +0200 Subject: [PATCH 02/10] Bump graphql-core to 3.3.0a1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 835f8abc..2229d211 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages install_requires = [ - "graphql-core>=3.2,<3.3", + "graphql-core>=3.3.0a1,<3.4", "yarl>=1.6,<2.0", "backoff>=1.11.1,<3.0", ] From 45c444070bfd9ea64242fd356d58b00941757a85 Mon Sep 17 00:00:00 2001 From: Hanusz Leszek Date: Sun, 25 Sep 2022 00:22:41 +0200 Subject: [PATCH 03/10] fix lines too long --- tests/test_aiohttp.py | 3 ++- tests/test_requests.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_aiohttp.py b/tests/test_aiohttp.py index 632f4f23..46410ab0 100644 --- a/tests/test_aiohttp.py +++ b/tests/test_aiohttp.py @@ -905,7 +905,8 @@ async def handler(request): """ 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]}}' ) diff --git a/tests/test_requests.py b/tests/test_requests.py index b7044a71..5a222664 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -661,7 +661,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]}}' ) From ae2819d5474e7a886a2ded38c208ffaa82de951a Mon Sep 17 00:00:00 2001 From: Hanusz Leszek Date: Sun, 25 Sep 2022 00:30:05 +0200 Subject: [PATCH 04/10] Drop support for Python 3.6 --- README.md | 2 +- docs/gql-cli/intro.rst | 2 +- docs/intro.rst | 2 +- setup.py | 4 +--- tox.ini | 5 ++--- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8e0ac68b..12e34b01 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/docs/gql-cli/intro.rst b/docs/gql-cli/intro.rst index b4565b01..93f16d32 100644 --- a/docs/gql-cli/intro.rst +++ b/docs/gql-cli/intro.rst @@ -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. diff --git a/docs/intro.rst b/docs/intro.rst index 9685a980..bbe1cbf6 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -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`_, diff --git a/setup.py b/setup.py index 2229d211..29f35069 100644 --- a/setup.py +++ b/setup.py @@ -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 = [ @@ -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", diff --git a/tox.ini b/tox.ini index e75b8fac..239a981e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,10 @@ [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 @@ -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] From 6ee2719e44683984099faae035c5d5ee80f6bbc9 Mon Sep 17 00:00:00 2001 From: Hanusz Leszek Date: Sun, 25 Sep 2022 00:43:05 +0200 Subject: [PATCH 05/10] Remove test for Python 3.6 in GitHub actions --- .github/workflows/tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a0631101..d79add14 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,11 +8,9 @@ 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"] os: [ubuntu-latest, windows-latest] exclude: - - os: windows-latest - python-version: "3.6" - os: windows-latest python-version: "3.7" - os: windows-latest From baaf19edee945a0bff917cfc962772571e84c0e1 Mon Sep 17 00:00:00 2001 From: Hanusz Leszek Date: Sun, 25 Sep 2022 00:52:22 +0200 Subject: [PATCH 06/10] tox.ini change pypy3 to pypy-3 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 239a981e..070b5bf2 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ python = 3.8: py38 3.9: py39 3.10: py310 - pypy3: pypy3 + pypy-3: pypy3 [testenv] conda_channels = conda-forge From ec20c9befc6b3a17fde48f54f65c419bc107ae4c Mon Sep 17 00:00:00 2001 From: Hanusz Leszek Date: Sun, 25 Sep 2022 01:01:11 +0200 Subject: [PATCH 07/10] GitHub actions: bump pypy3 from Python 3.6 to Python 3.9 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d79add14..74709e52 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "pypy3"] + python-version: ["3.7", "3.8", "3.9", "3.10", "pypy3.9"] os: [ubuntu-latest, windows-latest] exclude: - os: windows-latest From 7e1321c88db78902173d937504024b4198c9a67d Mon Sep 17 00:00:00 2001 From: Hanusz Leszek Date: Sun, 25 Sep 2022 01:04:45 +0200 Subject: [PATCH 08/10] trying with pypy3.8 --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 74709e52..0d054f89 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "pypy3.9"] + python-version: ["3.7", "3.8", "3.9", "3.10", "pypy3.8"] os: [ubuntu-latest, windows-latest] exclude: - os: windows-latest @@ -18,7 +18,7 @@ jobs: - os: windows-latest python-version: "3.10" - os: windows-latest - python-version: "pypy3" + python-version: "pypy3.8" steps: - uses: actions/checkout@v2 From 7fa431b5de931ce4172d649ebca68a346bae8097 Mon Sep 17 00:00:00 2001 From: Hanusz Leszek Date: Sun, 25 Sep 2022 01:12:37 +0200 Subject: [PATCH 09/10] GitHub actions bump checkout to v3 and setup-python to v4 --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/lint.yml | 4 ++-- .github/workflows/tests.yml | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2a6cdc6b..73778df5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6ed6d6ea..0f9f0a07 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d054f89..3716767d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,9 +21,9 @@ jobs: 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 @@ -43,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 @@ -59,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 From e64605cb837f6f1483bd5c5972ae486acf1820ee Mon Sep 17 00:00:00 2001 From: Hanusz Leszek Date: Mon, 7 Nov 2022 21:43:39 +0100 Subject: [PATCH 10/10] Bump graphql-core to 3.3.0a2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 29f35069..9615906f 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages install_requires = [ - "graphql-core>=3.3.0a1,<3.4", + "graphql-core>=3.3.0a2,<3.4", "yarl>=1.6,<2.0", "backoff>=1.11.1,<3.0", ]