Skip to content
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

Pin dependencies #20

Merged
merged 9 commits into from
Mar 16, 2020
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
23 changes: 15 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
language: python
sudo: false

python:
- 3.6
- 3.7
- 3.8

matrix:
include:
- python: '3.5'
env: TOX_ENV=py35,flake8
- python: '3.6'
env: TOX_ENV=py36
- python: '3.7'
env: TOXENV=flake8

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
- coveralls
49 changes: 26 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
from setuptools import setup, find_packages

required_packages = [
'graphql-core>=2.1',
'graphql-server-core>=1.1.1',
'sanic>=0.5.1',
'pytest-runner'
"graphql-core>=2.1,<3",
"graphql-server-core>=1.1.1,<2",
"sanic>=0.5.1,<19",
]

tests_require = ["pytest>=2.7.3", "aiohttp>=3.5.0,<4", "yarl>=1.0,<2.0", "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='[email protected]',
license='MIT',
name="Sanic-GraphQL",
version="1.1.0",
description="Adds GraphQL support to your Sanic application",
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",
author_email="[email protected]",
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",
)
10 changes: 1 addition & 9 deletions tests/test_graphiqlview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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}'
Expand Down
19 changes: 3 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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 tests}

[testenv:flake8]
deps = flake8
Expand Down