Skip to content

Commit ef0ac89

Browse files
committed
Support Python 3.11
1 parent 4c8ecd4 commit ef0ac89

File tree

9 files changed

+30
-19
lines changed

9 files changed

+30
-19
lines changed

.github/workflows/lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v3
1111

12-
- name: Set up Python 3.9
12+
- name: Set up Python 3.10
1313
uses: actions/setup-python@v4
1414
with:
15-
python-version: 3.9
15+
python-version: 3.10
1616

1717
- name: Install dependencies
1818
run: |

.github/workflows/publish.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v3
1414

15-
- name: Set up Python 3.9
15+
- name: Set up Python 3.10
1616
uses: actions/setup-python@v4
1717
with:
18-
python-version: 3.9
18+
python-version: 3.10
1919

2020
- name: Build wheel and source tarball
2121
run: |

.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: ['3.7', '3.8', '3.9', '3.10', 'pypy3.9']
11+
python: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy3.9']
1212

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

.readthedocs.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
version: 2
66

77
build:
8-
os: ubuntu-20.04
8+
os: ubuntu-22.04
99
tools:
10-
python: "3.9"
10+
python: "3.10"
1111

1212
sphinx:
1313
configuration: docs/conf.py

docs/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
EnterLeaveVisitor
139139
FormattedSourceLocation
140140
GraphQLAbstractType
141+
GraphQLErrorExtensions
141142
GraphQLOutputType
142143
asyncio.events.AbstractEventLoop
143144
graphql.execution.map_async_iterator.MapAsyncIterator

pyproject.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ classifiers = [
1919
"Programming Language :: Python :: 3.7",
2020
"Programming Language :: Python :: 3.8",
2121
"Programming Language :: Python :: 3.9",
22-
"Programming Language :: Python :: 3.10"
22+
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11"
2324
]
2425
packages = [
2526
{ include = "graphql", from = "src" },
@@ -80,7 +81,7 @@ sphinx_rtd_theme = ">=1,<2"
8081
exclude_dirs = ["tests"]
8182

8283
[tool.black]
83-
target-version = ["py37", "py38", "py39", "py310"]
84+
target-version = ["py37", "py38", "py39", "py310", "py311"]
8485

8586
[tool.coverage.run]
8687
branch = true
@@ -119,7 +120,7 @@ force_single_line = false
119120
lines_after_imports = 2
120121

121122
[tool.mypy]
122-
python_version = 3.9
123+
python_version = "3.10"
123124
check_untyped_defs = true
124125
no_implicit_optional = true
125126
strict_optional = true

tests/execution/test_nonnull.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import asyncio
12
import re
23
from typing import Any, Awaitable, cast
34

@@ -482,6 +483,7 @@ def describe_nulls_the_top_level_if_non_nullable_field():
482483
@mark.asyncio
483484
async def returns_null():
484485
result = await execute_sync_and_async(query, NullingData())
486+
await asyncio.sleep(0) # strangely needed to get coverage on Python 3.11
485487
assert result == (
486488
None,
487489
[
@@ -497,6 +499,7 @@ async def returns_null():
497499
@mark.asyncio
498500
async def throws():
499501
result = await execute_sync_and_async(query, ThrowingData())
502+
await asyncio.sleep(0) # strangely needed to get coverage on Python 3.11
500503
assert result == (
501504
None,
502505
[

tests/pyutils/test_is_awaitable.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
from inspect import isawaitable
3+
from sys import version_info as python_version
34

45
from pytest import mark
56

@@ -75,8 +76,12 @@ async def some_coroutine():
7576
assert isawaitable(some_coroutine())
7677
assert is_awaitable(some_coroutine())
7778

78-
@mark.filterwarnings("ignore::Warning") # Deprecation and Runtime
79-
def recognizes_an_old_style_coroutine():
79+
@mark.filterwarnings("ignore::Warning") # Deprecation and Runtime warnings
80+
@mark.skipif(
81+
python_version >= (3, 11),
82+
reason="Generator-based coroutines not supported any more since Python 3.11",
83+
)
84+
def recognizes_an_old_style_coroutine(): # pragma: no cover
8085
@asyncio.coroutine
8186
def some_old_style_coroutine():
8287
yield False # pragma: no cover

tox.ini

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py3{7,8,9,10}, pypy39, black, flake8, isort, mypy, docs
2+
envlist = py3{7,8,9,10,11}, pypy39, black, flake8, isort, mypy, docs
33
isolated_build = true
44

55
[gh-actions]
@@ -8,18 +8,19 @@ python =
88
3.7: py37
99
3.8: py38
1010
3.9: py39
11-
3.10: py310
11+
3.10: py310<g
12+
3.11: py311
1213
pypy3: pypy39
1314
pypy3.9: pypy39
1415

1516
[testenv:black]
16-
basepython = python3.9
17+
basepython = python3.10
1718
deps = black==22.10.0
1819
commands =
1920
black src tests -t py39 --check
2021

2122
[testenv:flake8]
22-
basepython = python3.9
23+
basepython = python3.10
2324
deps =
2425
flake8>=5,<6
2526
flake8-bandit>=4.1,<6
@@ -28,21 +29,21 @@ commands =
2829
flake8 src tests
2930

3031
[testenv:isort]
31-
basepython = python3.9
32+
basepython = python3.10
3233
deps = isort>=5.10,<6
3334
commands =
3435
isort src tests --check-only
3536

3637
[testenv:mypy]
37-
basepython = python3.9
38+
basepython = python3.10
3839
deps =
3940
mypy==0.982
4041
pytest>=7.1,<8
4142
commands =
4243
mypy src tests
4344

4445
[testenv:docs]
45-
basepython = python3.9
46+
basepython = python3.10
4647
deps =
4748
sphinx>=5.2.1,<6
4849
sphinx_rtd_theme>=1,<2

0 commit comments

Comments
 (0)