Skip to content

Commit

Permalink
Merge 3c0549a into 5b40324
Browse files Browse the repository at this point in the history
  • Loading branch information
ekampf committed Jun 2, 2019
2 parents 5b40324 + 3c0549a commit 5d85dcc
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 27 deletions.
13 changes: 0 additions & 13 deletions graphene/pyutils/compat.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
from __future__ import absolute_import

import six

from graphql.pyutils.compat import Enum

try:
from inspect import signature
except ImportError:
from .signature import signature

if six.PY2:

def func_name(func):
return func.func_name


else:

def func_name(func):
return func.__name__
3 changes: 1 addition & 2 deletions graphene/test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from promise import Promise, is_thenable
import six
from graphql.error import format_error as format_graphql_error
from graphql.error import GraphQLError

Expand All @@ -10,7 +9,7 @@ def default_format_error(error):
if isinstance(error, GraphQLError):
return format_graphql_error(error)

return {"message": six.text_type(error)}
return {"message": str(error)}


def format_execution_result(execution_result, format_error):
Expand Down
7 changes: 3 additions & 4 deletions graphene/types/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from aniso8601 import parse_date, parse_datetime, parse_time
from graphql.language import ast
from six import string_types

from .scalars import Scalar

Expand Down Expand Up @@ -35,7 +34,7 @@ def parse_value(value):
try:
if isinstance(value, datetime.date):
return value
elif isinstance(value, string_types):
elif isinstance(value, str):
return parse_date(value)
except ValueError:
return None
Expand Down Expand Up @@ -65,7 +64,7 @@ def parse_value(value):
try:
if isinstance(value, datetime.datetime):
return value
elif isinstance(value, string_types):
elif isinstance(value, str):
return parse_datetime(value)
except ValueError:
return None
Expand Down Expand Up @@ -95,7 +94,7 @@ def parse_value(cls, value):
try:
if isinstance(value, datetime.time):
return value
elif isinstance(value, string_types):
elif isinstance(value, str):
return parse_time(value)
except ValueError:
return None
3 changes: 1 addition & 2 deletions graphene/types/scalars.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import six
from typing import Any

from graphql.language.ast import BooleanValue, FloatValue, IntValue, StringValue
Expand Down Expand Up @@ -113,7 +112,7 @@ class String(Scalar):
def coerce_string(value):
if isinstance(value, bool):
return u"true" if value else u"false"
return six.text_type(value)
return str(value)

serialize = coerce_string
parse_value = coerce_string
Expand Down
4 changes: 1 addition & 3 deletions graphene/types/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from collections import OrderedDict
from functools import partial

from six import string_types

from ..utils.module_loading import import_string
from .mountedtype import MountedType
from .unmountedtype import UnmountedType
Expand Down Expand Up @@ -39,7 +37,7 @@ def yank_fields_from_attrs(attrs, _as=None, sort=True):


def get_type(_type):
if isinstance(_type, string_types):
if isinstance(_type, str):
return import_string(_type)
if inspect.isfunction(_type) or isinstance(_type, partial):
return _type()
Expand Down
3 changes: 1 addition & 2 deletions graphene/types/uuid.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from __future__ import absolute_import
import six
from uuid import UUID as _UUID

from graphql.language import ast
Expand All @@ -12,7 +11,7 @@ class UUID(Scalar):

@staticmethod
def serialize(uuid):
if isinstance(uuid, six.string_types):
if isinstance(uuid, str):
uuid = _UUID(uuid)

assert isinstance(uuid, _UUID), "Expected UUID instance, received {}".format(
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def run_tests(self):
keywords="api graphql protocol rest relay graphene",
packages=find_packages(exclude=["tests", "tests.*", "examples"]),
install_requires=[
"six>=1.10.0,<2",
"graphql-core>=2.1,<3",
"graphql-relay>=0.4.5,<1",
"aniso8601>=3,<=6.0.*",
Expand Down

0 comments on commit 5d85dcc

Please sign in to comment.