Skip to content

Commit d30c776

Browse files
CaselITvytas7
andauthored
pipelines with py3.11 on 3.1.1 branch (#2105)
* chore: formalize CPython 3.11 support (#2097) (cherry picked from commit 3816217) # Conflicts: # docs/changes/4.0.0.rst # pyproject.toml # requirements/tests * chore: use ranges for python 3.11 in the pipeline to allow versions after the rc1 (cherry picked from commit 8c03a68) * chore: work around Hypercorn bug in version 0.14.0 and 0.14.1 (cherry picked from commit bada832) * style: fix formatting * chore: fix yaml syntax * chore: remove authors that were added in v4 branch * chore: re-add author that's in 3.1.1 release * chore: use try/catch on corowrapper that was removed in python 3.11 * docs: ignore flake8 error on docstring that seem unsolvable * chore: fix error on install ModuleNotFoundError: No module named 'pbr' * fix: typo in commit 26d3d74 Co-authored-by: Vytautas Liuolia <vytautas.liuolia@gmail.com>
1 parent 89660bf commit d30c776

10 files changed

Lines changed: 34 additions & 10 deletions

File tree

.github/workflows/create-wheels.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
- "3.8"
3030
- "3.9"
3131
- "3.10"
32+
- "3.11.0-rc - 3.11"
3233
architecture:
3334
- x64
3435

@@ -93,11 +94,11 @@ jobs:
9394
- "ubuntu-latest"
9495
python-version:
9596
# the versions are <python tag>-<abi tag> as specified in PEP 425.
96-
- cp36-cp36m
9797
- cp37-cp37m
9898
- cp38-cp38
9999
- cp39-cp39
100100
- cp310-cp310
101+
- cp311-cp311
101102
architecture:
102103
- x64
103104

@@ -237,11 +238,11 @@ jobs:
237238
- "ubuntu-latest"
238239
python-version:
239240
# the versions are <python tag>-<abi tag> as specified in PEP 425.
240-
- cp36-cp36m
241241
- cp37-cp37m
242242
- cp38-cp38
243243
- cp39-cp39
244244
- cp310-cp310
245+
- cp311-cp311
245246
architecture:
246247
- aarch64
247248
- s390x

.github/workflows/mintest.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
python-version:
1818
- "3.8"
1919
- "3.10"
20+
- "3.11.0-rc - 3.11"
2021

2122
steps:
2223
- name: Checkout repo

.github/workflows/tests.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ jobs:
7676
- python-version: "3.10"
7777
os: ubuntu-20.04
7878
toxenv: py310_cython
79+
- python-version: "3.11.0-rc - 3.11"
80+
os: ubuntu-latest
81+
toxenv: py311
82+
- python-version: "3.11.0-rc - 3.11"
83+
os: ubuntu-latest
84+
toxenv: py311_cython
7985
- python-version: 3.8
8086
os: ubuntu-20.04
8187
toxenv: py38_sans_msgpack

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ listed below by date of first contribution:
119119
* signalw
120120
* Laurent Chriqui (laurent-chriqui)
121121
* Andrii Oriekhov (andriyor)
122+
* Tom Boshoven (TBoshoven)
122123

123124
(et al.)
124125

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ pip install -U blue
3737
$ blue .
3838
```
3939

40-
You can check all this by running ``tox`` from within the Falcon project directory. Your environment must be based on CPython 3.8 or 3.10:
40+
You can check all this by running ``tox`` from within the Falcon project directory. Your environment must be based on CPython 3.8, 3.10 or 3.11:
4141

4242
```bash
4343
$ pip install -U tox

falcon/asgi/response.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
# limitations under the License.
1414

1515
"""ASGI Response class."""
16-
17-
from asyncio.coroutines import CoroWrapper # type: ignore
16+
try:
17+
from asyncio.coroutines import CoroWrapper # type: ignore
18+
except ImportError:
19+
CoroWrapper = None # type: ignore
1820
from inspect import iscoroutine
1921
from inspect import iscoroutinefunction
2022

@@ -323,7 +325,9 @@ def schedule(self, callback):
323325
# NOTE(kgriffs): We also have to do the CoroWrapper check because
324326
# iscoroutine is less reliable under Python 3.6.
325327
if not iscoroutinefunction(callback):
326-
if iscoroutine(callback) or isinstance(callback, CoroWrapper):
328+
if iscoroutine(callback) or (
329+
CoroWrapper is not None and isinstance(callback, CoroWrapper)
330+
):
327331
raise TypeError(
328332
'The callback object appears to '
329333
'be a coroutine, rather than a coroutine function. Please '

falcon/util/sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ async def sync_to_async(func, *args, **kwargs):
156156
Returns:
157157
function: An awaitable coroutine function that wraps the
158158
synchronous callable.
159-
"""
159+
""" # noqa
160160

161161
return await get_running_loop().run_in_executor(
162162
None, partial(func, *args, **kwargs)

requirements/tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ mujson
2121
ujson
2222

2323
# it's slow to compile on emulated architectures; wheels missing for some EoL interpreters
24-
python-rapidjson; python_version >= '3.7' and platform_machine != 's390x' and platform_machine != 'aarch64'
24+
python-rapidjson; platform_machine != 's390x' and platform_machine != 'aarch64'
2525

2626
# wheels are missing some EoL interpreters and non-x86 platforms; build would fail unless rust is available
2727
orjson; python_version >= '3.7' and platform_python_implementation != 'PyPy' and platform_machine != 's390x' and platform_machine != 'aarch64'

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ classifiers =
3030
Programming Language :: Python :: 3.8
3131
Programming Language :: Python :: 3.9
3232
Programming Language :: Python :: 3.10
33+
Programming Language :: Python :: 3.11
3334
Programming Language :: Cython
3435
keywords =
3536
asgi
@@ -87,6 +88,8 @@ filterwarnings =
8788
ignore:Using or importing the ABCs:DeprecationWarning
8889
ignore:cannot collect test class 'TestClient':pytest.PytestCollectionWarning
8990
ignore:inspect.getargspec\(\) is deprecated:DeprecationWarning
91+
ignore:.cgi. is deprecated and slated for removal:DeprecationWarning
92+
ignore:path is deprecated\\. Use files\\(\\) instead:DeprecationWarning
9093

9194
[flake8]
9295
max-complexity = 15

tox.ini

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ deps = {[testenv]deps}
5757
daphne
5858

5959
[testenv:hypercorn]
60+
# TODO(vytas): Unpin Hypercorn once the buggy versions are yanked upstream.
6061
deps = {[testenv]deps}
61-
hypercorn
62+
hypercorn != 0.14.0, != 0.14.1
6263

6364
# --------------------------------------------------------------------
6465
# Test without optional packages
@@ -173,7 +174,7 @@ setenv =
173174
FALCON_ASGI_WRAP_NON_COROUTINES=Y
174175
FALCON_TESTING_SESSION=Y
175176
PYTHONASYNCIODEBUG=1
176-
install_command = python -m pip install --no-build-isolation {opts} {packages}
177+
install_command = python -m pip install {opts} {packages}
177178
commands = pytest tests []
178179

179180
[testenv:py35_cython]
@@ -218,6 +219,13 @@ deps = {[with-cython]deps}
218219
setenv = {[with-cython]setenv}
219220
commands = {[with-cython]commands}
220221

222+
[testenv:py311_cython]
223+
basepython = python3.11
224+
install_command = {[with-cython]install_command}
225+
deps = {[with-cython]deps}
226+
setenv = {[with-cython]setenv}
227+
commands = {[with-cython]commands}
228+
221229
# --------------------------------------------------------------------
222230
# WSGI servers (Cythonized Falcon)
223231
# --------------------------------------------------------------------

0 commit comments

Comments
 (0)