Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Jan 18, 2025
1 parent a4e5778 commit 666ecdc
Show file tree
Hide file tree
Showing 25 changed files with 367 additions and 250 deletions.
503 changes: 315 additions & 188 deletions poetry.lock

Large diffs are not rendered by default.

28 changes: 17 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Changelog = "https://github.com/graphql-python/graphql-core/releases"
[tool.poetry.dependencies]
python = "^3.7"
typing-extensions = [
{ version = "^4.12", python = ">=3.8,<3.10" },
{ version = "^4.12.2", python = ">=3.8,<3.10" },
{ version = "^4.7.1", python = "<3.8" },
]

Expand All @@ -57,18 +57,23 @@ pytest = [
{ version = "^7.4", python = "<3.8" }
]
pytest-asyncio = [
{ version = "^0.23.8", python = ">=3.8" },
{ version = "^0.25.2", python = ">=3.9" },
{ version = "~0.24.0", python = ">=3.8,<3.9" },
{ version = "~0.21.1", python = "<3.8" }
]
pytest-benchmark = "^4.0"
pytest-benchmark = [
{ version = "^5.1", python = ">=3.9" },
{ version = "^4.0", python = "<3.9" }
]
pytest-cov = [
{ version = "^5.0", python = ">=3.8" },
{ version = "^6.0", python = ">=3.9" },
{ version = "^5.0", python = ">=3.8,<3.9" },
{ version = "^4.1", python = "<3.8" },
]
pytest-describe = "^2.2"
pytest-timeout = "^2.3"
pytest-codspeed = [
{ version = "^3.1.0", python = ">=3.9" },
{ version = "^3.1.2", python = ">=3.9" },
{ version = "^2.2.1", python = "<3.8" }
]
tox = [
Expand All @@ -80,22 +85,22 @@ tox = [
optional = true

[tool.poetry.group.lint.dependencies]
ruff = ">=0.8,<0.9"
ruff = ">=0.9,<0.10"
mypy = [
{ version = "^1.12", python = ">=3.8" },
{ version = "^1.14", python = ">=3.8" },
{ version = "~1.4", python = "<3.8" }
]
bump2version = ">=1.0,<2"
bump2version = ">=1,<2"

[tool.poetry.group.doc]
optional = true

[tool.poetry.group.doc.dependencies]
sphinx = [
{ version = ">=7,<8", python = ">=3.8" },
{ version = ">=7,<9", python = ">=3.8" },
{ version = ">=4,<6", python = "<3.8" }
]
sphinx_rtd_theme = "^2.0"
sphinx_rtd_theme = ">=2,<4"

[tool.ruff]
line-length = 88
Expand Down Expand Up @@ -149,6 +154,7 @@ select = [
"YTT", # flake8-2020
]
ignore = [
"A005", # allow using standard-lib module names
"ANN401", # allow explicit Any
"COM812", # allow trailing commas for auto-formatting
"D105", "D107", # no docstring needed for magic methods
Expand Down Expand Up @@ -324,5 +330,5 @@ testpaths = ["tests"]
asyncio_default_fixture_loop_scope = "function"

[build-system]
requires = ["poetry_core>=1.6.1,<2"]
requires = ["poetry_core>=1.6.1,<3"]
build-backend = "poetry.core.masonry.api"
3 changes: 1 addition & 2 deletions src/graphql/execution/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ def get_argument_values(
coerced_values[arg_def.out_name or name] = arg_def.default_value
elif is_non_null_type(arg_type): # pragma: no cover else
msg = (
f"Argument '{name}' of required type '{arg_type}'"
" was not provided."
f"Argument '{name}' of required type '{arg_type}' was not provided."
)
raise GraphQLError(msg, node)
continue # pragma: no cover
Expand Down
6 changes: 3 additions & 3 deletions src/graphql/language/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def read_escaped_unicode_variable_width(self, position: int) -> EscapeSequence:
raise GraphQLSyntaxError(
self.source,
position,
f"Invalid Unicode escape sequence: '{body[position: position + size]}'.",
f"Invalid Unicode escape sequence: '{body[position : position + size]}'.",
)

def read_escaped_unicode_fixed_width(self, position: int) -> EscapeSequence:
Expand All @@ -368,7 +368,7 @@ def read_escaped_unicode_fixed_width(self, position: int) -> EscapeSequence:
raise GraphQLSyntaxError(
self.source,
position,
f"Invalid Unicode escape sequence: '{body[position: position + 6]}'.",
f"Invalid Unicode escape sequence: '{body[position : position + 6]}'.",
)

def read_escaped_character(self, position: int) -> EscapeSequence:
Expand All @@ -380,7 +380,7 @@ def read_escaped_character(self, position: int) -> EscapeSequence:
raise GraphQLSyntaxError(
self.source,
position,
f"Invalid character escape sequence: '{body[position: position + 2]}'.",
f"Invalid character escape sequence: '{body[position : position + 2]}'.",
)

def read_block_string(self, start: int) -> Token:
Expand Down
3 changes: 1 addition & 2 deletions src/graphql/type/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,7 @@ def __init__(
self.parse_literal = parse_literal # type: ignore
if parse_literal is not None and parse_value is None:
msg = (
f"{name} must provide"
" both 'parse_value' and 'parse_literal' functions."
f"{name} must provide both 'parse_value' and 'parse_literal' functions."
)
raise TypeError(msg)
self.specified_by_url = specified_by_url
Expand Down
3 changes: 1 addition & 2 deletions src/graphql/type/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,7 @@ class TypeKind(Enum):
),
"NON_NULL": GraphQLEnumValue(
TypeKind.NON_NULL,
description="Indicates this type is a non-null."
" `ofType` is a valid field.",
description="Indicates this type is a non-null. `ofType` is a valid field.",
),
},
)
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/type/scalars.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def parse_id_literal(value_node: ValueNode, _variables: Any = None) -> str:
GraphQLBoolean,
GraphQLID,
)
}
} # pyright: ignore


def is_specified_scalar_type(type_: GraphQLNamedType) -> TypeGuard[GraphQLScalarType]:
Expand Down
3 changes: 1 addition & 2 deletions src/graphql/type/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,7 @@ def validate_input_fields(self, input_obj: GraphQLInputObjectType) -> None:

if not fields:
self.report_error(
f"Input Object type {input_obj.name}"
" must define one or more fields.",
f"Input Object type {input_obj.name} must define one or more fields.",
[input_obj.ast_node, *input_obj.extension_ast_nodes],
)

Expand Down
4 changes: 2 additions & 2 deletions src/graphql/utilities/find_breaking_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def find_union_type_changes(
schema_changes.append(
DangerousChange(
DangerousChangeType.TYPE_ADDED_TO_UNION,
f"{possible_type.name} was added" f" to union type {old_type.name}.",
f"{possible_type.name} was added to union type {old_type.name}.",
)
)

Expand Down Expand Up @@ -407,7 +407,7 @@ def find_arg_changes(
schema_changes.append(
BreakingChange(
BreakingChangeType.ARG_REMOVED,
f"{old_type.name}.{field_name} arg" f" {arg_name} was removed.",
f"{old_type.name}.{field_name} arg {arg_name} was removed.",
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
def reason_message(reason: ConflictReasonMessage) -> str:
if isinstance(reason, list):
return " and ".join(
f"subfields '{response_name}' conflict"
f" because {reason_message(sub_reason)}"
f"subfields '{response_name}' conflict because {reason_message(sub_reason)}"
for response_name, sub_reason in reason
)
return reason
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ def check_field_uniqueness(
elif field_name in field_names:
self.report_error(
GraphQLError(
f"Field '{type_name}.{field_name}'"
" can only be defined once.",
f"Field '{type_name}.{field_name}' can only be defined once.",
[field_names[field_name], field_def.name],
)
)
Expand Down
2 changes: 1 addition & 1 deletion tests/error/test_graphql_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def serializes_to_include_all_standard_fields():
extensions = {"foo": "bar "}
e_full = GraphQLError("msg", field_node, None, None, path, None, extensions)
assert str(e_full) == (
"msg\n\nGraphQL request:2:3\n" "1 | {\n2 | field\n | ^\n3 | }"
"msg\n\nGraphQL request:2:3\n1 | {\n2 | field\n | ^\n3 | }"
)
assert repr(e_full) == (
"GraphQLError('msg', locations=[SourceLocation(line=2, column=3)],"
Expand Down
4 changes: 2 additions & 2 deletions tests/execution/test_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
def sync_and_async(spec):
"""Decorator for running a test synchronously and asynchronously."""
return pytest.mark.asyncio(
pytest.mark.parametrize("sync", (True, False), ids=("sync", "async"))(spec)
pytest.mark.parametrize("sync", [True, False], ids=("sync", "async"))(spec)
)


def access_variants(spec):
"""Decorator for tests with dict and object access, including inheritance."""
return pytest.mark.asyncio(
pytest.mark.parametrize("access", ("dict", "object", "inheritance"))(spec)
pytest.mark.parametrize("access", ["dict", "object", "inheritance"])(spec)
)


Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test_oneof.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def execute_query(
def describe_execute_handles_one_of_input_objects():
def describe_one_of_input_objects():
root_value = {
"test": lambda _info, input: input,
"test": lambda _info, input: input, # noqa: A006
}

def accepts_a_good_default_value():
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, id: int): # noqa: A002
"article": GraphQLField(
BlogArticle,
args={"id": GraphQLArgument(GraphQLID)},
resolve=lambda _obj, _info, id: Article(id),
resolve=lambda _obj, _info, id: Article(id), # noqa: A006
),
"feed": GraphQLField(
GraphQLList(BlogArticle),
Expand Down
3 changes: 1 addition & 2 deletions tests/language/test_lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,7 @@ def lexes_block_strings():
TokenKind.BLOCK_STRING, 0, 19, 1, 1, "slashes \\\\ \\/"
)
assert lex_one(
'"""\n\n spans\n multiple\n'
' lines\n\n """'
'"""\n\n spans\n multiple\n lines\n\n """'
) == Token(TokenKind.BLOCK_STRING, 0, 68, 1, 1, "spans\n multiple\n lines")

def advance_line_after_lexing_multiline_block_string():
Expand Down
3 changes: 1 addition & 2 deletions tests/language/test_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ def correctly_prints_mutation_operation_with_artifacts():

def prints_query_with_variable_directives():
query_ast_with_variable_directive = parse(
"query ($foo: TestType = { a: 123 }"
" @testDirective(if: true) @test) { id }"
"query ($foo: TestType = { a: 123 } @testDirective(if: true) @test) { id }"
)
assert print_ast(query_ast_with_variable_directive) == dedent(
"""
Expand Down
10 changes: 4 additions & 6 deletions tests/star_wars_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@
"name": GraphQLField(GraphQLString, description="The name of the human."),
"friends": GraphQLField(
GraphQLList(character_interface),
description="The friends of the human,"
" or an empty list if they have none.",
description="The friends of the human, or an empty list if they have none.",
resolve=lambda human, _info: get_friends(human),
),
"appearsIn": GraphQLField(
Expand Down Expand Up @@ -182,8 +181,7 @@
"name": GraphQLField(GraphQLString, description="The name of the droid."),
"friends": GraphQLField(
GraphQLList(character_interface),
description="The friends of the droid,"
" or an empty list if they have none.",
description="The friends of the droid, or an empty list if they have none.",
resolve=lambda droid, _info: get_friends(droid),
),
"appearsIn": GraphQLField(
Expand Down Expand Up @@ -238,7 +236,7 @@
GraphQLNonNull(GraphQLString), description="id of the human"
)
},
resolve=lambda _source, _info, id: get_human(id),
resolve=lambda _source, _info, id: get_human(id), # noqa: A006
),
"droid": GraphQLField(
droid_type,
Expand All @@ -247,7 +245,7 @@
GraphQLNonNull(GraphQLString), description="id of the droid"
)
},
resolve=lambda _source, _info, id: get_droid(id),
resolve=lambda _source, _info, id: get_droid(id), # noqa: A006
),
},
)
Expand Down
3 changes: 1 addition & 2 deletions tests/type/test_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ def parse_literal(_node: ValueNode, _vars=None):
with pytest.raises(TypeError) as exc_info:
GraphQLScalarType("SomeScalar", parse_literal=parse_literal)
assert str(exc_info.value) == (
"SomeScalar must provide both"
" 'parse_value' and 'parse_literal' functions."
"SomeScalar must provide both 'parse_value' and 'parse_literal' functions."
)

def pickles_a_custom_scalar_type():
Expand Down
3 changes: 1 addition & 2 deletions tests/type/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ def rejects_a_schema_whose_query_root_type_is_not_an_object_type():
)
assert validate_schema(schema) == [
{
"message": "Query root type must be Object type,"
" it cannot be Query.",
"message": "Query root type must be Object type, it cannot be Query.",
"locations": [(2, 13)],
}
]
Expand Down
3 changes: 1 addition & 2 deletions tests/utilities/test_extend_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1363,8 +1363,7 @@ def does_not_allow_replacing_a_default_directive():
with pytest.raises(TypeError) as exc_info:
extend_schema(schema, extend_ast)
assert str(exc_info.value).startswith(
"Directive '@include' already exists in the schema."
" It cannot be redefined."
"Directive '@include' already exists in the schema. It cannot be redefined."
)

def does_not_allow_replacing_an_existing_enum_value():
Expand Down
3 changes: 1 addition & 2 deletions tests/utilities/test_find_breaking_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,7 @@ def should_detect_all_breaking_changes():
),
(
BreakingChangeType.TYPE_CHANGED_KIND,
"TypeThatChangesType changed from an Object type to an"
" Interface type.",
"TypeThatChangesType changed from an Object type to an Interface type.",
),
(
BreakingChangeType.FIELD_REMOVED,
Expand Down
3 changes: 1 addition & 2 deletions tests/utilities/test_type_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,7 @@ def leave(*args):

assert print_ast(edited_ast) == print_ast(
parse(
"{ human(id: 4) { name, pets { __typename } },"
" alien { __typename } }"
"{ human(id: 4) { name, pets { __typename } }, alien { __typename } }"
)
)

Expand Down
3 changes: 1 addition & 2 deletions tests/validation/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ def deprecated_validates_using_a_custom_type_info():
"Cannot query field 'human' on type 'QueryRoot'. Did you mean 'human'?",
"Cannot query field 'meowsVolume' on type 'Cat'."
" Did you mean 'meowsVolume'?",
"Cannot query field 'barkVolume' on type 'Dog'."
" Did you mean 'barkVolume'?",
"Cannot query field 'barkVolume' on type 'Dog'. Did you mean 'barkVolume'?",
]

def validates_using_a_custom_rule():
Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,33 @@ python =

[testenv:ruff]
basepython = python3.12
deps = ruff>=0.8,<0.9
deps = ruff>=0.9,<0.10
commands =
ruff check src tests
ruff format --check src tests

[testenv:mypy]
basepython = python3.12
deps =
mypy>=1.12,<2
mypy>=1.14,<2
pytest>=8.3,<9
commands =
mypy src tests

[testenv:docs]
basepython = python3.12
deps =
sphinx>=7,<8
sphinx_rtd_theme>=2.0,<3
sphinx>=8,<9
sphinx_rtd_theme>=3,<4
commands =
sphinx-build -b html -nEW docs docs/_build/html

[testenv]
deps =
pytest>=7.4,<9
pytest-asyncio>=0.21.1,<1
pytest-benchmark>=4,<5
pytest-cov>=4.1,<6
pytest-benchmark>=4,<6
pytest-cov>=4.1,<7
pytest-describe>=2.2,<3
pytest-timeout>=2.3,<3
py3{7,8,9}, pypy39: typing-extensions>=4.7.1,<5
Expand Down

0 comments on commit 666ecdc

Please sign in to comment.