From f1577dafa2eb8a501fce1e2a40ddc3ed0be00411 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Mon, 16 Mar 2020 09:42:09 +0000 Subject: [PATCH 1/9] Pin dependencies and update travis config --- .travis.yml | 11 ++++++----- setup.py | 5 ++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index f71c862..00fd497 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,17 +2,18 @@ language: python sudo: false matrix: include: - - python: '3.5' - env: TOX_ENV=py35,flake8 + - python: '3.7' + env: TOX_ENV=flake8 - python: '3.6' - env: TOX_ENV=py36 + - python: '3.7' + - python: '3.8' cache: directories: - $HOME/.cache/pip - $TRAVIS_BUILD_DIR/.tox install: -- pip install tox coveralls +- pip install tox tox-travis coveralls script: -- tox -e $TOX_ENV +- tox after_success: - coveralls diff --git a/setup.py b/setup.py index 59f7617..ded0754 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,9 @@ from setuptools import setup, find_packages required_packages = [ - 'graphql-core>=2.1', - 'graphql-server-core>=1.1.1', + 'graphql-core>=2.1,<3', + 'graphql-server-core>=1.1.1,<2', 'sanic>=0.5.1', - 'pytest-runner' ] setup( From 41106943f6a5aad82ab8a6ee663d551360b59336 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Mon, 16 Mar 2020 09:47:54 +0000 Subject: [PATCH 2/9] Set TOX_ENV --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 00fd497..e712368 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,6 @@ cache: install: - pip install tox tox-travis coveralls script: -- tox +- tox -e $TOX_ENV after_success: - coveralls From 1e8a370a58874aba750d57fa46c57495fef30469 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Mon, 16 Mar 2020 09:55:14 +0000 Subject: [PATCH 3/9] Update setup.py and tox settings --- setup.py | 48 ++++++++++++++++++++++++++---------------------- tox.ini | 19 +++---------------- 2 files changed, 29 insertions(+), 38 deletions(-) diff --git a/setup.py b/setup.py index ded0754..8b65d4c 100644 --- a/setup.py +++ b/setup.py @@ -1,33 +1,37 @@ from setuptools import setup, find_packages required_packages = [ - 'graphql-core>=2.1,<3', - 'graphql-server-core>=1.1.1,<2', - 'sanic>=0.5.1', + "graphql-core>=2.1,<3", + "graphql-server-core>=1.1.1,<2", + "sanic>=0.5.1", ] +tests_require = ["pytest>=2.7.3", "aiohttp>=1.3.0", "yarl>=0.9.6", "jinja2>=2.9.0"] + setup( - name='Sanic-GraphQL', - version='1.1.0', - description='Adds GraphQL support to your Sanic application', - long_description=open('README.rst').read(), - url='https://github.com/graphql-python/sanic-graphql', - download_url='https://github.com/graphql-python/sanic-graphql/releases', - author='Sergey Porivaev', - author_email='porivaevs@gmail.com', - license='MIT', + name="Sanic-GraphQL", + version="1.1.0", + description="Adds GraphQL support to your Sanic application", + long_description=open("README.rst").read(), + url="https://github.com/graphql-python/sanic-graphql", + download_url="https://github.com/graphql-python/sanic-graphql/releases", + author="Sergey Porivaev", + author_email="porivaevs@gmail.com", + license="MIT", classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Topic :: Software Development :: Libraries', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'License :: OSI Approved :: MIT License', + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Topic :: Software Development :: Libraries", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License", ], - keywords='api graphql protocol sanic', - packages=find_packages(exclude=['tests']), + keywords="api graphql protocol sanic", + packages=find_packages(exclude=["tests"]), install_requires=required_packages, - tests_require=['pytest>=2.7.3', 'aiohttp>=1.3.0', 'yarl>=0.9.6', 'jinja2>=2.9.0'], + tests_require=tests_require, + extras_require={"test": tests_require}, include_package_data=True, - platforms='any', + platforms="any", ) diff --git a/tox.ini b/tox.ini index 2612ab4..720672d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,26 +1,13 @@ [tox] -envlist = py35, py36, flake8 +envlist = flake8,py36,py37,py38 skipsdist = true -[travis] -python = - 3.5: py35, flake8 - 3.6: py36, flake8 - [testenv] deps = - pytest>=2.7.2 - graphql-core>=1.0 - graphql-server-core>=1.0.dev - sanic>=0.3.1 - aiohttp>=1.3.0 - jinja2>=2.9.0 - yarl>=0.9.6 - pytest-runner - coverage + .[test] commands = - coverage run --source=sanic_graphql setup.py test + {posargs:py.test --cov=sanic_graphql tests} [testenv:flake8] deps = flake8 From d47543228ade22f9914b9a74082e7438e48aa4e7 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Mon, 16 Mar 2020 10:04:47 +0000 Subject: [PATCH 4/9] Update travis config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e712368..00fd497 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,6 @@ cache: install: - pip install tox tox-travis coveralls script: -- tox -e $TOX_ENV +- tox after_success: - coveralls From cf90ba0497083af2bca72d26f3d79f436b0da65b Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Mon, 16 Mar 2020 10:12:59 +0000 Subject: [PATCH 5/9] Some more tweaks --- .travis.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 00fd497..277d1c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ sudo: false matrix: include: - python: '3.7' - env: TOX_ENV=flake8 + env: TOXENV=flake8 - python: '3.6' - python: '3.7' - python: '3.8' diff --git a/tox.ini b/tox.ini index 720672d..6275bd4 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ deps = .[test] commands = - {posargs:py.test --cov=sanic_graphql tests} + {posargs:py.test tests} [testenv:flake8] deps = flake8 From c682cc709cedbb4e9b3b51b80e98497df9a97226 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Mon, 16 Mar 2020 11:04:27 +0000 Subject: [PATCH 6/9] Get mostly working dependency versions --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8b65d4c..ff3726e 100644 --- a/setup.py +++ b/setup.py @@ -3,10 +3,10 @@ required_packages = [ "graphql-core>=2.1,<3", "graphql-server-core>=1.1.1,<2", - "sanic>=0.5.1", + "sanic>=0.5.1,<19", ] -tests_require = ["pytest>=2.7.3", "aiohttp>=1.3.0", "yarl>=0.9.6", "jinja2>=2.9.0"] +tests_require = ["pytest>=2.7.3", "aiohttp>=3.5.0,<4", "yarl>=1.0,<2.0", "jinja2==2.9.0"] setup( name="Sanic-GraphQL", From 6d661f2fa86c5deebebb0ff73aab3b8cfddcdff0 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Mon, 16 Mar 2020 11:21:02 +0000 Subject: [PATCH 7/9] Fix tests --- tests/test_graphiqlview.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tests/test_graphiqlview.py b/tests/test_graphiqlview.py index 66cc8cb..5fdbf4d 100644 --- a/tests/test_graphiqlview.py +++ b/tests/test_graphiqlview.py @@ -19,7 +19,7 @@ def pretty_response(): @parametrize_sync_async_app_test('app', graphiql=True) def test_graphiql_is_enabled(app): - _, response = app.client.get( uri=url_string(), headers={'Accept': 'text/html'}) + _, response = app.client.get(uri=url_string(query="{test}"), headers={'Accept': 'text/html'}) assert response.status == 200 @@ -50,14 +50,6 @@ def test_graphiql_html_is_not_accepted(app): assert response.status == 400 -@parametrize_sync_async_app_test('app', graphiql=True) -def test_graphiql_get_mutation(app, pretty_response): - query = 'mutation TestMutation { writeTest { test } }' - _, response = app.client.get(uri=url_string(query=query), headers={'Accept': 'text/html'}) - assert response.status == 200 - assert 'response: null' in response.body.decode('utf-8') - - @pytest.mark.parametrize('app', [create_app(async_executor=True, graphiql=True, schema=AsyncSchema)]) def test_graphiql_asyncio_schema(app): query = '{a,b,c}' From c435fb9ba65598c7ca59795dbdf1f674e17b9ab1 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Mon, 16 Mar 2020 16:36:44 +0000 Subject: [PATCH 8/9] Use language option in travis config --- .travis.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 277d1c1..d335468 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,25 @@ language: python -sudo: false + +python: + - 3.6 + - 3.7 + - 3.8 + matrix: include: - python: '3.7' env: TOXENV=flake8 - - python: '3.6' - - python: '3.7' - - python: '3.8' + cache: directories: - $HOME/.cache/pip - $TRAVIS_BUILD_DIR/.tox + install: -- pip install tox tox-travis coveralls + - pip install tox tox-travis coveralls + script: -- tox + - tox + after_success: -- coveralls + - coveralls From 107b0ca8b3eb2ab2e984311533e9f0358d2914d8 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Mon, 16 Mar 2020 16:39:10 +0000 Subject: [PATCH 9/9] Open readme with utf-8 encoding --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ff3726e..6e2e5d6 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ name="Sanic-GraphQL", version="1.1.0", description="Adds GraphQL support to your Sanic application", - long_description=open("README.rst").read(), + long_description=open("README.rst", encoding="utf-8").read(), url="https://github.com/graphql-python/sanic-graphql", download_url="https://github.com/graphql-python/sanic-graphql/releases", author="Sergey Porivaev",