Skip to content

Commit

Permalink
Prepare version 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Jan 23, 2020
1 parent 2c8728e commit d69324c
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 48 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ matrix:
python: 3.7
dist: xenial
sudo: true # required workaround for https://github.com/travis-ci/travis-ci/issues/9815
- env: TOXENV=pypy
- env: TOXENV=pypy2
python: pypy
- env: TOXENV=pypy
python: pypy3
- env: TOXENV=pre-commit
python: 3.6
- env: TOXENV=mypy
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
# built documents.
#
# The short X.Y version.
version = "0.1"
version = "2.3"
# The full version, including alpha/beta/rc tags.
release = "0.1a0"
release = "2.3.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion graphql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
set_default_backend,
)

VERSION = (2, 2, 1, "final", 0)
VERSION = (2, 3, 0, "final", 0)
__version__ = get_version(VERSION)


Expand Down
4 changes: 2 additions & 2 deletions graphql/backend/compiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def _from_namespace(cls, schema, namespace):
execute = namespace["execute"] # type: Callable

namespace["schema"] = schema
return cls( # type: ignore
return cls(
schema=schema,
document_string=document_string,
document_ast=document_ast,
document_ast=document_ast, # type: ignore
execute=execute,
)
10 changes: 7 additions & 3 deletions graphql/execution/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,9 @@ def complete_value(
exe_context, return_type, field_asts, info, path, resolved
),
lambda error: Promise.rejected( # type: ignore
GraphQLLocatedError(field_asts, original_error=error, path=path)
GraphQLLocatedError( # type: ignore
field_asts, original_error=error, path=path
)
),
)

Expand Down Expand Up @@ -602,8 +604,10 @@ def complete_list_value(
completed_results.append(completed_item)
index += 1

return ( # type: ignore
Promise.all(completed_results) if contains_promise else completed_results
return (
Promise.all(completed_results) # type: ignore
if contains_promise
else completed_results
)


Expand Down
31 changes: 16 additions & 15 deletions graphql/language/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,33 +476,33 @@ def parse_value_literal(parser, is_const):

elif token.kind == TokenKind.INT:
advance(parser)
return ast.IntValue( # type: ignore
value=token.value, loc=loc(parser, token.start)
return ast.IntValue(
value=token.value, loc=loc(parser, token.start) # type: ignore
)

elif token.kind == TokenKind.FLOAT:
advance(parser)
return ast.FloatValue( # type: ignore
value=token.value, loc=loc(parser, token.start)
return ast.FloatValue(
value=token.value, loc=loc(parser, token.start) # type: ignore
)

elif token.kind == TokenKind.STRING:
advance(parser)
return ast.StringValue( # type: ignore
value=token.value, loc=loc(parser, token.start)
return ast.StringValue(
value=token.value, loc=loc(parser, token.start) # type: ignore
)

elif token.kind == TokenKind.NAME:
if token.value in ("true", "false"):
advance(parser)
return ast.BooleanValue( # type: ignore
return ast.BooleanValue(
value=token.value == "true", loc=loc(parser, token.start)
)

if token.value != "null":
advance(parser)
return ast.EnumValue( # type: ignore
value=token.value, loc=loc(parser, token.start)
return ast.EnumValue(
value=token.value, loc=loc(parser, token.start) # type: ignore
)

elif token.kind == TokenKind.DOLLAR:
Expand Down Expand Up @@ -728,10 +728,10 @@ def parse_field_definition(parser):
# type: (Parser) -> FieldDefinition
start = parser.token.start

return ast.FieldDefinition( # type: ignore
return ast.FieldDefinition(
name=parse_name(parser),
arguments=parse_argument_defs(parser),
type=expect(parser, TokenKind.COLON) and parse_type(parser),
type=expect(parser, TokenKind.COLON) and parse_type(parser), # type: ignore
directives=parse_directives(parser),
loc=loc(parser, start),
)
Expand All @@ -749,9 +749,9 @@ def parse_input_value_def(parser):
# type: (Parser) -> InputValueDefinition
start = parser.token.start

return ast.InputValueDefinition( # type: ignore
return ast.InputValueDefinition(
name=parse_name(parser),
type=expect(parser, TokenKind.COLON) and parse_type(parser),
type=expect(parser, TokenKind.COLON) and parse_type(parser), # type: ignore
default_value=parse_const_value(parser)
if skip(parser, TokenKind.EQUALS)
else None,
Expand Down Expand Up @@ -780,10 +780,11 @@ def parse_union_type_definition(parser):
start = parser.token.start
expect_keyword(parser, "union")

return ast.UnionTypeDefinition( # type: ignore
return ast.UnionTypeDefinition(
name=parse_name(parser),
directives=parse_directives(parser),
types=expect(parser, TokenKind.EQUALS) and parse_union_members(parser),
types=expect(parser, TokenKind.EQUALS) # type: ignore
and parse_union_members(parser),
loc=loc(parser, start),
)

Expand Down
4 changes: 2 additions & 2 deletions graphql/language/visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ def visit(root, visitor, key_map=None):
if not is_leaving:
stack = Stack(in_array, index, keys, edits, stack)
in_array = isinstance(node, list)
keys = ( # type: ignore
node
keys = (
node # type: ignore
if in_array
else visitor_keys.get(type(node), None) or [] # type: ignore
)
Expand Down
23 changes: 13 additions & 10 deletions graphql/validation/rules/overlapping_fields_can_be_merged.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,12 +621,15 @@ def _get_referenced_fields_and_fragment_names(
if cached:
return cached

fragment_type = type_from_ast( # type: ignore
context.get_schema(), fragment.type_condition
fragment_type = type_from_ast(
context.get_schema(), fragment.type_condition # type: ignore
)

return _get_fields_and_fragments_names( # type: ignore
context, cached_fields_and_fragment_names, fragment_type, fragment.selection_set
return _get_fields_and_fragments_names(
context,
cached_fields_and_fragment_names,
fragment_type, # type: ignore
fragment.selection_set,
)


Expand Down Expand Up @@ -659,15 +662,15 @@ def _collect_fields_and_fragment_names(
elif isinstance(selection, ast.InlineFragment):
type_condition = selection.type_condition
if type_condition:
inline_fragment_type = type_from_ast( # type: ignore
context.get_schema(), selection.type_condition
inline_fragment_type = type_from_ast(
context.get_schema(), selection.type_condition # type: ignore
)
else:
inline_fragment_type = parent_type # type: ignore

_collect_fields_and_fragment_names( # type: ignore
_collect_fields_and_fragment_names(
context,
inline_fragment_type,
inline_fragment_type, # type: ignore
selection.selection_set,
ast_and_defs,
fragment_names,
Expand All @@ -683,8 +686,8 @@ def _subfield_conflicts(
# type: (...) -> Optional[Tuple[Tuple[str, str], List[Node], List[Node]]]
"""Given a series of Conflicts which occurred between two sub-fields, generate a single Conflict."""
if conflicts:
return ( # type: ignore
(response_name, [conflict[0] for conflict in conflicts]),
return (
(response_name, [conflict[0] for conflict in conflicts]), # type: ignore
tuple(itertools.chain([ast1], *[conflict[1] for conflict in conflicts])),
tuple(itertools.chain([ast2], *[conflict[2] for conflict in conflicts])),
)
Expand Down
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

sys.path[:] = path_copy

install_requires = ["six>=1.10.0", "promise>=2.3", "rx>=1.6,<3"]
install_requires = ["six>=1.10.0", "promise>=2.3,<3", "rx>=1.6,<2"]

tests_requires = [
"pytest>=3.3,<4.0",
"pytest==3.10.1",
"pytest-django==2.9.1",
"pytest-cov==2.3.1",
"coveralls",
"gevent>=1.1",
"coveralls==1.10.0",
"gevent==1.4.0",
"six>=1.10.0",
"pytest-benchmark==3.0.0",
"pytest-mock==1.2",
Expand Down Expand Up @@ -67,7 +67,6 @@ def run_tests(self):
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
Expand Down
14 changes: 7 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[tox]
envlist = py{27,34,35,36,37,py},pre-commit,mypy,docs
envlist = py{27,35,36,37,py,py3},pre-commit,mypy,docs

[testenv]
deps =
.[test]
commands =
py{27,34,py}: py.test graphql tests {posargs}
py{35,36,37}: py.test graphql tests tests_py35 {posargs}
py{27,py}: py.test graphql tests {posargs}
py{35,36,37,py3}: py.test graphql tests tests_py35 {posargs}

[testenv:pre-commit]
basepython=python3.6
basepython=python3.7
deps =
pre-commit>0.12.0
pre-commit==1.21.0
setenv =
LC_CTYPE=en_US.UTF-8
commands =
pre-commit {posargs:run --all-files}

[testenv:mypy]
basepython=python3.6
basepython=python3.7
deps =
mypy==0.720
mypy==0.761
commands =
mypy graphql --ignore-missing-imports

Expand Down

0 comments on commit d69324c

Please sign in to comment.