Skip to content

Commit aaff333

Browse files
rmk135gen-xu
andauthored
Python 3.11 Support (ets-labs#647)
* Update tests * Enable tests on 3.11 * Fix coverage config in tox.ini * feat: re cythonize to support python 3.11 (ets-labs#646) * feat: re cythonize to support python 3.11 * misc: added tox env for python 3.11 * misc: add classifiers for python 3.11 * fix: skip tests for removed functions * misc: CI updates for python 3.11 Co-authored-by: Roman Mogylatov <[email protected]> * Update tests and linters job * Update test skip decorators * Fix tox.ini * Update 3.10 to be explicit string literal * Move pypy3 to legacy job * Fix error in resourse typing test * Update publishing job * Update actions and setup-python versions * Update changelog * Update pypy * Update tox.ini with new pypy versions * Update publishing job * Update actions/upload-artifact@v3 * Update ubuntu to 22.04 on docs publishing job * Update actions/download-artifact@v3 and pypa/gh-action-pypi-publish@release/v1 Co-authored-by: Gen Xu <[email protected]>
1 parent 3858cef commit aaff333

File tree

11 files changed

+237
-67
lines changed

11 files changed

+237
-67
lines changed

.github/workflows/publishing.yml

+40-42
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Publishing
22

33
on:
4+
workflow_dispatch:
45
push:
56
tags:
67
- '*'
@@ -9,28 +10,28 @@ jobs:
910

1011
tests:
1112
name: Run tests
12-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-22.04
1314
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-python@v2
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v4
1617
with:
17-
python-version: "3.10"
18+
python-version: 3.11
1819
- run: pip install tox
1920
- run: tox
2021
env:
21-
TOXENV: "3.10"
22+
TOXENV: 3.11
2223

2324
linters:
2425
name: Run linters
25-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-22.04
2627
strategy:
2728
matrix:
2829
toxenv: [flake8, pydocstyle, mypy, pylint]
2930
steps:
30-
- uses: actions/checkout@v2
31-
- uses: actions/setup-python@v2
31+
- uses: actions/checkout@v3
32+
- uses: actions/setup-python@v4
3233
with:
33-
python-version: "3.10"
34+
python-version: 3.11
3435
- run: pip install tox
3536
- run: tox
3637
env:
@@ -39,14 +40,14 @@ jobs:
3940
build-sdist:
4041
name: Build source tarball
4142
needs: [tests, linters]
42-
runs-on: ubuntu-20.04
43+
runs-on: ubuntu-22.04
4344
steps:
44-
- uses: actions/checkout@v2
45-
- uses: actions/setup-python@v2
45+
- uses: actions/checkout@v3
46+
- uses: actions/setup-python@v4
4647
with:
47-
python-version: "3.10"
48+
python-version: 3.11
4849
- run: python setup.py sdist
49-
- uses: actions/upload-artifact@v2
50+
- uses: actions/upload-artifact@v3
5051
with:
5152
path: ./dist/*
5253

@@ -56,63 +57,60 @@ jobs:
5657
runs-on: ${{ matrix.os }}
5758
strategy:
5859
matrix:
59-
os: [ubuntu-20.04, windows-2019, macOS-10.15]
60+
os: [ubuntu-22.04, windows-2019, macos-11]
6061
env:
6162
CIBW_SKIP: cp27-win*
6263
steps:
63-
- uses: actions/checkout@v2
64-
- uses: actions/setup-python@v2
65-
with:
66-
python-version: "3.10"
67-
- run: pip install cibuildwheel==2.1.3
68-
- run: cibuildwheel --output-dir wheelhouse
69-
- uses: actions/upload-artifact@v2
64+
- uses: actions/checkout@v3
65+
- name: Build wheels
66+
uses: pypa/[email protected]
67+
- uses: actions/upload-artifact@v3
7068
with:
7169
path: ./wheelhouse/*.whl
7270

7371
build-wheels-linux-aarch64:
74-
name: Build wheels (ubuntu-latest-aarch64)
72+
name: Build wheels (ubuntu-22.04-aarch64)
7573
needs: [tests, linters]
76-
runs-on: ubuntu-20.04
74+
runs-on: ubuntu-22.04
7775
steps:
78-
- uses: actions/checkout@v2
76+
- uses: actions/checkout@v3
7977
- name: Set up QEMU
80-
uses: docker/setup-qemu-action@v1
81-
- uses: actions/setup-python@v2
82-
with:
83-
python-version: "3.10"
84-
- run: pip install cibuildwheel==2.1.3
85-
- run: cibuildwheel --archs aarch64 --output-dir wheelhouse
86-
- uses: actions/upload-artifact@v2
78+
if: runner.os == 'Linux'
79+
uses: docker/setup-qemu-action@v2
80+
- name: Build wheels
81+
uses: pypa/[email protected]
82+
env:
83+
CIBW_ARCHS_LINUX: aarch64
84+
- uses: actions/upload-artifact@v3
8785
with:
8886
path: ./wheelhouse/*.whl
8987

9088
publish:
9189
name: Publish on PyPI
9290
needs: [build-sdist, build-wheels, build-wheels-linux-aarch64]
93-
runs-on: ubuntu-20.04
91+
runs-on: ubuntu-22.04
9492
steps:
95-
- uses: actions/download-artifact@v2
93+
- uses: actions/download-artifact@v3
9694
with:
9795
name: artifact
9896
path: dist
99-
- uses: pypa/gh-action-pypi-publish@master
97+
- uses: pypa/gh-action-pypi-publish@release/v1
10098
with:
10199
user: __token__
102100
password: ${{ secrets.PYPI_API_TOKEN }}
103-
# For publishing to Test PyPI, uncomment next two lines:
104-
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
105-
# repository_url: https://test.pypi.org/legacy/
101+
# For publishing to Test PyPI, uncomment next two lines:
102+
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
103+
# repository_url: https://test.pypi.org/legacy/
106104

107105
publish-docs:
108106
name: Publish docs
109107
needs: [publish]
110-
runs-on: ubuntu-18.04
108+
runs-on: ubuntu-22.04
111109
steps:
112-
- uses: actions/checkout@v2
113-
- uses: actions/setup-python@v2
110+
- uses: actions/checkout@v3
111+
- uses: actions/setup-python@v4
114112
with:
115-
python-version: "3.10"
113+
python-version: 3.11
116114
- run: pip install -r requirements-doc.txt
117115
- run: pip install awscli
118116
- run: pip install -e .

.github/workflows/tests-and-linters.yml

+25-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,31 @@ on: [push, pull_request, workflow_dispatch]
44

55
jobs:
66

7+
tests-on-legacy-versions:
8+
name: Run tests on legacy versions
9+
runs-on: ubuntu-20.04
10+
strategy:
11+
matrix:
12+
python-version: [2.7, 3.5, 3.6, 3.7, pypy2.7, pypy3.9]
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-python@v4
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- run: pip install tox
19+
- run: tox
20+
env:
21+
TOXENV: ${{ matrix.python-version }}
22+
723
test-on-different-versions:
824
name: Run tests
925
runs-on: ubuntu-latest
1026
strategy:
1127
matrix:
12-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, "3.10", pypy2, pypy3]
28+
python-version: [3.8, 3.9, "3.10", 3.11]
1329
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-python@v2
30+
- uses: actions/checkout@v3
31+
- uses: actions/setup-python@v4
1632
with:
1733
python-version: ${{ matrix.python-version }}
1834
- run: pip install tox
@@ -28,10 +44,10 @@ jobs:
2844
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
2945
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3046
steps:
31-
- uses: actions/checkout@v2
32-
- uses: actions/setup-python@v2
47+
- uses: actions/checkout@v3
48+
- uses: actions/setup-python@v4
3349
with:
34-
python-version: "3.10"
50+
python-version: 3.11
3551
- run: pip install tox cython
3652
- run: make cythonize
3753
- run: tox
@@ -45,10 +61,10 @@ jobs:
4561
matrix:
4662
toxenv: [flake8, pydocstyle, mypy, pylint]
4763
steps:
48-
- uses: actions/checkout@v2
49-
- uses: actions/setup-python@v2
64+
- uses: actions/checkout@v3
65+
- uses: actions/setup-python@v4
5066
with:
51-
python-version: "3.10"
67+
python-version: 3.11
5268
- run: pip install tox
5369
- run: tox
5470
env:

docs/main/changelog.rst

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ that were made in every particular version.
77
From version 0.7.6 *Dependency Injector* framework strictly
88
follows `Semantic versioning`_
99

10+
Development version
11+
-------------------
12+
- Add support of Python 3.11.
13+
- Update CI/CD to use Ubuntu 22.04.
14+
- Update CI/CD to ``actions/checkout@v3``, ``actions/setup-python@v4``, ``actions/upload-artifact@v3``, ``pypa/[email protected]``,
15+
and ``actions/download-artifact@v3``.
16+
- Regenerate C sources using Cython 0.29.32.
17+
1018
4.40.0
1119
------
1220
- Add ``Configuration.from_json()`` method to load configuration from a json file.

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cython==0.29.30
1+
cython==0.29.32
22
pytest
33
pytest-asyncio
44
tox

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
"Programming Language :: Python :: 3.8",
107107
"Programming Language :: Python :: 3.9",
108108
"Programming Language :: Python :: 3.10",
109+
"Programming Language :: Python :: 3.11",
109110
"Programming Language :: Python :: Implementation :: CPython",
110111
"Programming Language :: Python :: Implementation :: PyPy",
111112
"Framework :: AsyncIO",

src/dependency_injector/_cwiring.c

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

0 commit comments

Comments
 (0)