Skip to content

Commit a25b40b

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

File tree

8 files changed

+279
-215
lines changed

8 files changed

+279
-215
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

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py3{7,8,9,10,11,12}, pypy3{9,10}, ruff, mypy, docs
2+
envlist = py3{7,8,9,10,11,12,13}, pypy3{9,10}, ruff, mypy, docs
33
isolated_build = true
44

55
[gh-actions]
@@ -11,21 +11,22 @@ python =
1111
3.10: py310
1212
3.11: py311
1313
3.12: py312
14+
3.13: py313
1415
pypy3: pypy39
1516
pypy3.9: pypy39
1617
pypy3.10: pypy310
1718

1819
[testenv:ruff]
1920
basepython = python3.12
20-
deps = ruff>=0.6.4,<0.7
21+
deps = ruff>=0.7,<0.8
2122
commands =
2223
ruff check src tests
2324
ruff format --check src tests
2425

2526
[testenv:mypy]
2627
basepython = python3.12
2728
deps =
28-
mypy>=1.11,<2
29+
mypy>=1.12,<2
2930
pytest>=8.3,<9
3031
commands =
3132
mypy src tests
@@ -50,5 +51,5 @@ deps =
5051
commands =
5152
# to also run the time-consuming tests: tox -e py311 -- --run-slow
5253
# to run the benchmarks: tox -e py311 -- -k benchmarks --benchmark-enable
53-
py3{7,8,9,10,11}, pypy3{9,10}: pytest tests {posargs}
54+
py3{7,8,9,10,11,13}, pypy3{9,10}: pytest tests {posargs}
5455
py312: pytest tests {posargs: --cov-report=term-missing --cov=graphql --cov=tests --cov-fail-under=100}

0 commit comments

Comments
 (0)