Skip to content

Commit 2a7976f

Browse files
committed
Support Python 3.13 and update dependencies
1 parent 4e83d42 commit 2a7976f

File tree

8 files changed

+277
-214
lines changed

8 files changed

+277
-214
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', 'pypy3.9', 'pypy3.10']
11+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy3.9', 'pypy3.10']
1212

1313
steps:
1414
- uses: actions/checkout@v4

poetry.lock

+261-202
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ classifiers = [
2222
"Programming Language :: Python :: 3.10",
2323
"Programming Language :: Python :: 3.11",
2424
"Programming Language :: Python :: 3.12",
25+
"Programming Language :: Python :: 3.13"
2526
]
2627
packages = [
2728
{ include = "graphql", from = "src" },
@@ -75,9 +76,9 @@ tox = [
7576
optional = true
7677

7778
[tool.poetry.group.lint.dependencies]
78-
ruff = ">=0.6.4,<0.7"
79+
ruff = ">=0.7,<0.8"
7980
mypy = [
80-
{ version = "^1.11", python = ">=3.8" },
81+
{ version = "^1.12", python = ">=3.8" },
8182
{ version = "~1.4", python = "<3.8" }
8283
]
8384
bump2version = ">=1.0,<2"

src/graphql/language/parser.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,9 @@ def parse_nullability_assertion(self) -> NullabilityAssertionNode | None:
471471
def parse_arguments(self, is_const: bool) -> list[ArgumentNode]:
472472
"""Arguments[Const]: (Argument[?Const]+)"""
473473
item = self.parse_const_argument if is_const else self.parse_argument
474-
item = cast(Callable[[], ArgumentNode], item)
475-
return self.optional_many(TokenKind.PAREN_L, item, TokenKind.PAREN_R)
474+
return self.optional_many(
475+
TokenKind.PAREN_L, cast(Callable[[], ArgumentNode], item), TokenKind.PAREN_R
476+
)
476477

477478
def parse_argument(self, is_const: bool = False) -> ArgumentNode:
478479
"""Argument[Const]: Name : Value[?Const]"""

src/graphql/language/visitor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def visit(
289289
else:
290290
stack = Stack(in_array, idx, keys, edits, stack)
291291
in_array = isinstance(node, tuple)
292-
keys = node if in_array else visitor_keys.get(node.kind, ())
292+
keys = node if in_array else visitor_keys.get(node.kind, ()) # type: ignore
293293
idx = -1
294294
edits = []
295295
if parent:

src/graphql/pyutils/async_reduce.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ def async_reduce(
3636
async def async_callback(
3737
current_accumulator: Awaitable[U], current_value: T
3838
) -> U:
39-
result = callback(await current_accumulator, current_value)
40-
return await cast(Awaitable, result) if is_awaitable(result) else result
39+
result: AwaitableOrValue[U] = callback(
40+
await current_accumulator, current_value
41+
)
42+
return await result if is_awaitable(result) else result # type: ignore
4143

4244
accumulator = async_callback(cast(Awaitable[U], accumulator), value)
4345
else:

tests/execution/test_abstract.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async def execute_query(
4242
assert isinstance(schema, GraphQLSchema)
4343
assert isinstance(query, str)
4444
document = parse(query)
45-
result = (execute_sync if sync else execute)(schema, document, root_value) # type: ignore
45+
result = (execute_sync if sync else execute)(schema, document, root_value)
4646
if not sync and is_awaitable(result):
4747
result = await result
4848
assert isinstance(result, ExecutionResult)

tox.ini

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ python =
1717

1818
[testenv:ruff]
1919
basepython = python3.12
20-
deps = ruff>=0.6.4,<0.7
20+
deps = ruff>=0.7,<0.8
2121
commands =
2222
ruff check src tests
2323
ruff format --check src tests
2424

2525
[testenv:mypy]
2626
basepython = python3.12
2727
deps =
28-
mypy>=1.11,<2
28+
mypy>=1.12,<2
2929
pytest>=8.3,<9
3030
commands =
3131
mypy src tests
@@ -50,5 +50,5 @@ deps =
5050
commands =
5151
# to also run the time-consuming tests: tox -e py311 -- --run-slow
5252
# to run the benchmarks: tox -e py311 -- -k benchmarks --benchmark-enable
53-
py3{7,8,9,10,11}, pypy3{9,10}: pytest tests {posargs}
53+
py3{7,8,9,10,11,13}, pypy3{9,10}: pytest tests {posargs}
5454
py312: pytest tests {posargs: --cov-report=term-missing --cov=graphql --cov=tests --cov-fail-under=100}

0 commit comments

Comments
 (0)