Use custom dedent function and pin graphql-core to >3.1.2

This commit is contained in:
Jonathan Kim 2020-07-09 16:36:41 +01:00
parent 9f28d2fde4
commit 1d3525e6f9
5 changed files with 15 additions and 5 deletions

View File

@ -1,7 +1,7 @@
import re
from graphql_relay import to_global_id
from graphql.pyutils import dedent
from graphene.tests.utils import dedent
from ...types import ObjectType, Schema, String
from ..node import Node, is_node

View File

@ -1,5 +1,6 @@
from graphql import graphql_sync
from graphql.pyutils import dedent
from graphene.tests.utils import dedent
from ...types import Interface, ObjectType, Schema
from ...types.scalars import Int, String

9
graphene/tests/utils.py Normal file
View File

@ -0,0 +1,9 @@
from textwrap import dedent as _dedent
def dedent(text: str) -> str:
"""Fix indentation of given text by removing leading spaces and tabs.
Also removes leading newlines and trailing spaces and tabs, but keeps trailing
newlines.
"""
return _dedent(text.lstrip("\n").rstrip(" \t"))

View File

@ -1,7 +1,7 @@
from graphql.type import GraphQLObjectType, GraphQLSchema
from pytest import raises
from graphql.type import GraphQLObjectType, GraphQLSchema
from graphql.pyutils import dedent
from graphene.tests.utils import dedent
from ..field import Field
from ..objecttype import ObjectType

View File

@ -82,7 +82,7 @@ setup(
keywords="api graphql protocol rest relay graphene",
packages=find_packages(exclude=["examples*"]),
install_requires=[
"graphql-core>=3.1.1,<4",
"graphql-core>=3.1.2,<4",
"graphql-relay>=3.0,<4",
"aniso8601>=8,<9",
],