From 150a527c0af139b6cae2f722a856eac591e1eda5 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 30 Apr 2021 12:12:28 -0400 Subject: [PATCH 01/10] Use v3 requirements, flask-graphql -> graphql-server --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index e15f40d..9502240 100644 --- a/setup.py +++ b/setup.py @@ -17,12 +17,12 @@ flask_requires = [ 'Flask>=1.0.2', - 'graphene>=2.1.2', - 'Flask-Graphql>=2.0.0', + 'graphene>=3.0b7', + 'graphql-server[flask]>=3.0.0b3', ] django_requires = [ - 'graphene-django>=2.0.0', + 'graphene-django>=3.0.0b6', ] all_requires = flask_requires + django_requires From 2d6fe3359bba563452985f40db0d2f6449090e7e Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 30 Apr 2021 12:12:56 -0400 Subject: [PATCH 02/10] Use graphql_server, not flask_graphql --- graphene_file_upload/flask/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphene_file_upload/flask/__init__.py b/graphene_file_upload/flask/__init__.py index 4cf769f..11b4284 100644 --- a/graphene_file_upload/flask/__init__.py +++ b/graphene_file_upload/flask/__init__.py @@ -1,7 +1,7 @@ """Apply multipart request spec to flask""" from flask import request -from flask_graphql import GraphQLView from graphql_server import load_json_body +from graphql_server.flask import GraphQLView from ..utils import place_files_in_operations From 2ce017f401e2a6c6280d417db51079b7894d0a86 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 30 Apr 2021 12:13:23 -0400 Subject: [PATCH 03/10] Use graphql_schema attribute for graphene v3 https://github.com/graphql-python/graphql-server/blob/master/docs/flask.md#special-note-for-graphene-v3 --- tests/flask_app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/flask_app.py b/tests/flask_app.py index de928a5..98384a4 100644 --- a/tests/flask_app.py +++ b/tests/flask_app.py @@ -1,6 +1,7 @@ from flask import Flask from graphene_file_upload.flask import FileUploadGraphQLView +from .schema import schema def create_app(schema, path='/graphql'): @@ -10,7 +11,7 @@ def create_app(schema, path='/graphql'): path, view_func=FileUploadGraphQLView.as_view( 'graphql', - schema=schema, + schema=schema.graphql_schema, ), ) return app From 27c718835e72f77ae8c6301003d2ccedf037962d Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 30 Apr 2021 14:14:30 -0400 Subject: [PATCH 04/10] Remove support for python < 3.6 --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 7891e20..1c84206 100644 --- a/tox.ini +++ b/tox.ini @@ -4,14 +4,14 @@ # and then run "tox" from this directory. [tox] -envlist = py27, py34, py35, py36, py37, py38, py39 +envlist = py36, py37, py38, py39 skip_missing_interpreters = true [testenv] deps = .[all,tests] - py3{4,5,6,7,8,9}: pylint + py3{6,7,8,9}: pylint commands = -coverage erase - py3{4,5,6,7,8,9}: pylint graphene_file_upload + py3{6,7,8,9}: pylint graphene_file_upload py.test --cov=graphene_file_upload -v tests/ From d3b730b810f461b65d2b9f0da7beb9c0be2d9fd4 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 30 Apr 2021 14:16:09 -0400 Subject: [PATCH 05/10] Remove explicit schema import --- tests/flask_app.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/flask_app.py b/tests/flask_app.py index 98384a4..78e2c22 100644 --- a/tests/flask_app.py +++ b/tests/flask_app.py @@ -1,8 +1,6 @@ from flask import Flask from graphene_file_upload.flask import FileUploadGraphQLView -from .schema import schema - def create_app(schema, path='/graphql'): app = Flask(__name__) From c5d815837ff5459c2e8f943cf81a97b1e8b62d33 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 30 Apr 2021 14:21:18 -0400 Subject: [PATCH 06/10] Remove flask-graphql from README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index dae2330..e8aa918 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,6 @@ urlpatterns = [ ### Flask Integration: -Note that `flask-graphql` version `<2.0` is not supported. At the time of -writing this README, you must install `flask-graphql` with -`pip install --pre flask-graphql` - Simply import the modified view and create a new url rule on your app: ```python From ea22cdb8dfaf433aac94550b3ccb4c7049b67936 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 30 Apr 2021 14:38:02 -0400 Subject: [PATCH 07/10] Add graphql_schema attribute to flask example --- examples/flask/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/flask/app.py b/examples/flask/app.py index b4ba28f..2f1f02e 100644 --- a/examples/flask/app.py +++ b/examples/flask/app.py @@ -37,6 +37,6 @@ class Mutation(graphene.ObjectType): view_func=FileUploadGraphQLView.as_view( 'graphql', graphiql=True, - schema=schema, + schema=schema.graphql_schema, ) ) From 881775f154e1e21452d5d1bc51bee113f9eb9442 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 30 Apr 2021 16:17:09 -0400 Subject: [PATCH 08/10] Remove Python < 3.6 from supported versions --- setup.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.py b/setup.py index 9502240..052d5f5 100644 --- a/setup.py +++ b/setup.py @@ -56,9 +56,6 @@ "Natural Language :: English", "Topic :: Internet :: WWW/HTTP", "Operating System :: OS Independent", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", From 101b5ab85dd44e9add4c6728075001665af8f085 Mon Sep 17 00:00:00 2001 From: Leah Date: Wed, 26 May 2021 12:33:39 -0400 Subject: [PATCH 09/10] Drop python 2.7, 3.4, 3.5 versions from travis --- .travis.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 00a4d54..4bcd1ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,6 @@ language: python matrix: include: - - python: 2.7 - env: TOXENV=py27 - - python: 3.4 - env: TOXENV=py34 - - python: 3.5 - env: TOXENV=py35 - python: 3.6 env: TOXENV=py36 - python: 3.7 From 7ec95e2f0ad3481cb13fb34b6b471ba32235985f Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 27 May 2021 12:26:54 -0400 Subject: [PATCH 10/10] Only run CI for pypy3 graphql-server v3 doesn't support Python 2 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4bcd1ea..2f0d289 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ matrix: env: TOXENV=py38 - python: 3.9 env: TOXENV=py39 - - python: pypy + - python: pypy3 env: TOXENV=pypy install: - pip install tox