Skip to content

Commit 72b3549

Browse files
committed
Update test dependencies, fix tests for core 2.3.2
1 parent e62328e commit 72b3549

File tree

6 files changed

+67
-89
lines changed

6 files changed

+67
-89
lines changed

gql/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging
22

3-
from graphql import build_ast_schema, build_client_schema, introspection_query, parse
3+
from graphql import (build_ast_schema, build_client_schema,
4+
introspection_query, parse)
45
from graphql.validation import validate
56

67
from .transport.local_schema import LocalSchemaTransport

gql/dsl.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@
33
import six
44
from graphql.language import ast
55
from graphql.language.printer import print_ast
6-
from graphql.type import (
7-
GraphQLEnumType,
8-
GraphQLInputObjectField,
9-
GraphQLInputObjectType,
10-
GraphQLList,
11-
GraphQLNonNull,
12-
)
6+
from graphql.type import (GraphQLEnumType, GraphQLInputObjectField,
7+
GraphQLInputObjectType, GraphQLList, GraphQLNonNull)
138
from graphql.utils.ast_from_value import ast_from_value
149

1510
from .utils import to_camel_case

setup.py

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,68 +3,67 @@
33
from setuptools import setup, find_packages
44

55
install_requires = [
6-
'six>=1.10.0',
7-
'graphql-core>=2,<3',
8-
'promise>=2.0,<3',
9-
'requests>=2.12,<3'
6+
"six>=1.10.0",
7+
"graphql-core>=2.3.2,<3",
8+
"promise>=2.3,<3",
9+
"requests>=2.12,<3",
1010
]
1111

12-
tests_require = [
13-
'coveralls==1.11.1',
14-
'pytest-cov==2.8.1',
15-
'mock==3.0.5',
16-
'vcrpy==3.0.0',
17-
]
18-
19-
if sys.version_info > (3, 6):
20-
tests_require.append([
21-
'pytest==5.4.1',
22-
'pytest-asyncio==0.11.0',
23-
])
24-
else:
25-
tests_require.append([
26-
'pytest==4.6.9',
27-
])
12+
tests_require = (
13+
[
14+
"pytest==5.4.2",
15+
"pytest-asyncio==0.11.0",
16+
"pytest-cov==2.8.1",
17+
"mock==4.0.2",
18+
"vcrpy==4.0.2",
19+
"coveralls==2.0.0",
20+
]
21+
if sys.version_info > (3, 6)
22+
else [
23+
"pytest==4.6.9",
24+
"pytest-cov==2.8.1",
25+
"vcrpy==3.0.0",
26+
"mock==3.0.0",
27+
"coveralls==1.11.1",
28+
]
29+
)
2830

2931
dev_requires = [
30-
'flake8==3.7.9',
31-
'isort<4.0.0',
32-
'black==19.10b0',
33-
'mypy==0.761',
34-
'check-manifest>=0.40,<1',
32+
"flake8==3.7.9",
33+
"isort<4.0.0",
34+
"black==19.10b0",
35+
"mypy==0.761",
36+
"check-manifest>=0.40,<1",
3537
] + tests_require
3638

3739
setup(
38-
name='gql',
39-
version='0.5.0',
40-
description='GraphQL client for Python',
41-
long_description=open('README.md').read(),
40+
name="gql",
41+
version="0.5.0",
42+
description="GraphQL client for Python",
43+
long_description=open("README.md").read(),
4244
long_description_content_type="text/markdown",
43-
url='https://github.com/graphql-python/gql',
44-
author='Syrus Akbary',
45-
author_email='[email protected]',
46-
license='MIT',
45+
url="https://github.com/graphql-python/gql",
46+
author="Syrus Akbary",
47+
author_email="[email protected]",
48+
license="MIT",
4749
classifiers=[
48-
'Development Status :: 3 - Alpha',
49-
'Intended Audience :: Developers',
50-
'Topic :: Software Development :: Libraries',
51-
'Programming Language :: Python :: 2',
52-
'Programming Language :: Python :: 2.7',
53-
'Programming Language :: Python :: 3',
54-
'Programming Language :: Python :: 3.5',
55-
'Programming Language :: Python :: 3.6',
56-
'Programming Language :: Python :: 3.7',
57-
'Programming Language :: Python :: 3.8',
58-
'Programming Language :: Python :: Implementation :: PyPy',
50+
"Development Status :: 3 - Alpha",
51+
"Intended Audience :: Developers",
52+
"Topic :: Software Development :: Libraries",
53+
"Programming Language :: Python :: 2",
54+
"Programming Language :: Python :: 2.7",
55+
"Programming Language :: Python :: 3",
56+
"Programming Language :: Python :: 3.5",
57+
"Programming Language :: Python :: 3.6",
58+
"Programming Language :: Python :: 3.7",
59+
"Programming Language :: Python :: 3.8",
60+
"Programming Language :: Python :: Implementation :: PyPy",
5961
],
60-
keywords='api graphql protocol rest relay gql client',
62+
keywords="api graphql protocol rest relay gql client",
6163
packages=find_packages(include=["gql*"]),
6264
install_requires=install_requires,
6365
tests_require=tests_require,
64-
extras_require={
65-
'test': tests_require,
66-
'dev': dev_requires,
67-
},
66+
extras_require={"test": tests_require, "dev": dev_requires,},
6867
include_package_data=True,
6968
zip_safe=False,
7069
platforms="any",

tests/starwars/schema.py

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
1-
from graphql.type import (
2-
GraphQLArgument,
3-
GraphQLEnumType,
4-
GraphQLEnumValue,
5-
GraphQLField,
6-
GraphQLInputObjectField,
7-
GraphQLInputObjectType,
8-
GraphQLInt,
9-
GraphQLInterfaceType,
10-
GraphQLList,
11-
GraphQLNonNull,
12-
GraphQLObjectType,
13-
GraphQLSchema,
14-
GraphQLString,
15-
)
1+
from graphql.type import (GraphQLArgument, GraphQLEnumType, GraphQLEnumValue,
2+
GraphQLField, GraphQLInputObjectField,
3+
GraphQLInputObjectType, GraphQLInt,
4+
GraphQLInterfaceType, GraphQLList, GraphQLNonNull,
5+
GraphQLObjectType, GraphQLSchema, GraphQLString)
166

17-
from .fixtures import (
18-
createReview,
19-
getCharacters,
20-
getDroid,
21-
getFriends,
22-
getHero,
23-
getHuman,
24-
)
7+
from .fixtures import (createReview, getCharacters, getDroid, getFriends,
8+
getHero, getHuman)
259

2610
episodeEnum = GraphQLEnumType(
2711
"Episode",
@@ -136,7 +120,7 @@
136120
"episode": GraphQLArgument(
137121
description="If omitted, returns the hero of the whole saga. If "
138122
"provided, returns the hero of that particular episode.",
139-
type=episodeEnum, # type: ignore
123+
type_=episodeEnum, # type: ignore
140124
)
141125
},
142126
resolver=lambda root, info, **args: getHero(args.get("episode")),
@@ -145,7 +129,7 @@
145129
humanType,
146130
args={
147131
"id": GraphQLArgument(
148-
description="id of the human", type=GraphQLNonNull(GraphQLString),
132+
description="id of the human", type_=GraphQLNonNull(GraphQLString),
149133
)
150134
},
151135
resolver=lambda root, info, **args: getHuman(args["id"]),
@@ -154,7 +138,7 @@
154138
droidType,
155139
args={
156140
"id": GraphQLArgument(
157-
description="id of the droid", type=GraphQLNonNull(GraphQLString),
141+
description="id of the droid", type_=GraphQLNonNull(GraphQLString),
158142
)
159143
},
160144
resolver=lambda root, info, **args: getDroid(args["id"]),
@@ -164,7 +148,7 @@
164148
args={
165149
"ids": GraphQLArgument(
166150
description="list of character ids",
167-
type=GraphQLList(GraphQLString),
151+
type_=GraphQLList(GraphQLString),
168152
)
169153
},
170154
resolver=lambda root, info, **args: getCharacters(args["ids"]),
@@ -181,10 +165,10 @@
181165
args={
182166
"episode": GraphQLArgument(
183167
description="Episode to create review",
184-
type=episodeEnum, # type: ignore
168+
type_=episodeEnum, # type: ignore
185169
),
186170
"review": GraphQLArgument(
187-
description="set alive status", type=reviewInputType,
171+
description="set alive status", type_=reviewInputType,
188172
),
189173
},
190174
resolver=lambda root, info, **args: createReview(

tests/test_client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import mock
44
import pytest
5-
from urllib3.exceptions import NewConnectionError
6-
75
from graphql import build_ast_schema, parse
6+
from urllib3.exceptions import NewConnectionError
87

98
from gql import Client, gql
109
from gql.transport.requests import RequestsHTTPTransport, Transport

tests_py36/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
args={
1313
'episode': GraphQLArgument(
1414
description='Episode to review',
15-
type=episodeEnum,
15+
type_=episodeEnum,
1616
)
1717
},
1818
resolver=lambda root, info, **args: reviewAdded(args.get('episode')),

0 commit comments

Comments
 (0)