Skip to content

Commit 32c76af

Browse files
committed
Bump version number, remove support for Python 2
Version 3 of gql only supports Python 3.6+
1 parent 369cabf commit 32c76af

File tree

11 files changed

+14
-37
lines changed

11 files changed

+14
-37
lines changed

gql-checker/gql_checker/__about__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import, division, print_function
2-
31
__all__ = [
42
"__title__", "__summary__", "__uri__", "__version__", "__author__",
53
"__email__", "__license__", "__copyright__",

gql-checker/setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"Development Status :: 4 - Beta",
5353
"License :: OSI Approved :: MIT License",
5454
"Programming Language :: Python",
55-
"Programming Language :: Python :: 2",
5655
"Programming Language :: Python :: 3",
5756
(
5857
"License :: OSI Approved :: "

gql/dsl.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from collections.abc import Iterable
12
from functools import partial
23

3-
import six
44
from graphql import (
55
ArgumentNode,
66
DocumentNode,
@@ -25,11 +25,6 @@
2525

2626
from .utils import to_camel_case
2727

28-
if six.PY3:
29-
from collections.abc import Iterable
30-
else:
31-
from collections import Iterable
32-
3328

3429
class DSLSchema(object):
3530
def __init__(self, client):

gql/gql.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import six
2-
from graphql.language.parser import parse
3-
from graphql.language.source import Source
1+
from graphql import Source, parse
42

53

64
def gql(request_string):
7-
if isinstance(request_string, six.string_types):
8-
source = Source(request_string, "GraphQL request")
9-
return parse(source)
10-
else:
11-
raise Exception('Received incompatible request "{}".'.format(request_string))
5+
if not isinstance(request_string, str):
6+
raise Exception(f'Received incompatible request "{request_string}".')
7+
source = Source(request_string, "GraphQL request")
8+
return parse(source)

gql/transport/async_transport.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import abc
22
from typing import AsyncGenerator, Dict, Optional
33

4-
import six
5-
from graphql.execution import ExecutionResult
6-
from graphql.language.ast import DocumentNode
4+
from graphql import DocumentNode, ExecutionResult
75

86

9-
@six.add_metaclass(abc.ABCMeta)
107
class AsyncTransport:
118
@abc.abstractmethod
129
async def connect(self):

gql/transport/local_schema.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from graphql import GraphQLSchema
2-
from graphql.execution import ExecutionResult, execute
3-
from graphql.language.ast import DocumentNode
1+
from graphql import DocumentNode, ExecutionResult, GraphQLSchema, execute
42

53
from gql.transport import Transport
64

gql/transport/transport.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import abc
22

3-
import six
4-
from graphql.execution import ExecutionResult
5-
from graphql.language.ast import DocumentNode
3+
from graphql import DocumentNode, ExecutionResult
64

75

8-
@six.add_metaclass(abc.ABCMeta)
96
class Transport:
107
@abc.abstractmethod
118
def execute(self, document: DocumentNode, *args, **kwargs) -> ExecutionResult:

setup.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"aiohttp==3.6.2",
55
"graphql-core>=3.1,<3.2",
66
"requests>=2.23,<3",
7-
"six>=1.10.0",
87
"websockets>=8.1,<9",
98
"yarl>=1.4,<2.0",
109
]
@@ -33,7 +32,7 @@
3332

3433
setup(
3534
name="gql",
36-
version="0.5.0",
35+
version="3.0.0dev",
3736
description="GraphQL client for Python",
3837
long_description=open("README.md").read(),
3938
long_description_content_type="text/markdown",
@@ -45,10 +44,7 @@
4544
"Development Status :: 3 - Alpha",
4645
"Intended Audience :: Developers",
4746
"Topic :: Software Development :: Libraries",
48-
"Programming Language :: Python :: 2",
49-
"Programming Language :: Python :: 2.7",
5047
"Programming Language :: Python :: 3",
51-
"Programming Language :: Python :: 3.5",
5248
"Programming Language :: Python :: 3.6",
5349
"Programming Language :: Python :: 3.7",
5450
"Programming Language :: Python :: 3.8",
@@ -58,7 +54,7 @@
5854
packages=find_packages(include=["gql*"]),
5955
install_requires=install_requires,
6056
tests_require=tests_require,
61-
extras_require={"test": tests_require, "dev": dev_requires,},
57+
extras_require={"test": tests_require, "dev": dev_requires},
6258
include_package_data=True,
6359
zip_safe=False,
6460
platforms="any",

tests/starwars/test_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from graphql.error import format_error
2+
from graphql import format_error
33

44
from gql import Client, gql
55
from tests.starwars.schema import StarWarsSchema

tests/starwars/test_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from .schema import StarWarsSchema
77

8-
introspection = graphql_sync(StarWarsSchema, get_introspection_query()).data # type: ignore
8+
introspection = graphql_sync(StarWarsSchema, get_introspection_query()).data
99

1010

1111
@pytest.fixture

0 commit comments

Comments
 (0)