Skip to content

Commit a5166bf

Browse files
rmk135anton-petrov
andauthored
Add Python 3.12 Support (#752) (#765)
* Add Python 3.12 Support (#752) * Ignore .vscode * Python 3.12 Support * Change base python to 3.12 and pin pydantic to V1 * all tests passed * ci: change default python to 3.12 * remove legacy python versions * annotate pydantic models for tests * Update publishing pipeline to use Python 3.12 * Test environment updates * Update Cython to the latest prior 3.0 version and remove tracing from CI/CD * Give up using editable tox installation in the coverage job * Add mypy test fixes * Remove tracing from the coverage job * Fix typing test * Remove PyPy 2.7 * Fix typing test * Fix the typing issue with pydantic * Remove pypy 3.9 * Fix the typing issue with mypy * Update pydantic version to the latest from 1.x * Update scipy deprecation warning filter * Fix the tox job running coveralls * Update changelog --------- Co-authored-by: Anton Petrov <[email protected]>
1 parent 98d5867 commit a5166bf

16 files changed

+1098
-1075
lines changed

Diff for: .coveragerc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[run]
2-
source = src/dependency_injector
2+
source = dependency_injector
33
omit = tests/unit
44
plugins = Cython.Coverage
55

Diff for: .github/workflows/publishing.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- uses: actions/setup-python@v4
1717
with:
18-
python-version: 3.11
18+
python-version: 3.12
1919
- run: pip install tox
2020
- run: tox
2121
env:
22-
TOXENV: 3.11
22+
TOXENV: 3.12
2323

2424
linters:
2525
name: Run linters
@@ -31,7 +31,7 @@ jobs:
3131
- uses: actions/checkout@v3
3232
- uses: actions/setup-python@v4
3333
with:
34-
python-version: 3.11
34+
python-version: 3.12
3535
- run: pip install tox
3636
- run: tox
3737
env:
@@ -45,7 +45,7 @@ jobs:
4545
- uses: actions/checkout@v3
4646
- uses: actions/setup-python@v4
4747
with:
48-
python-version: 3.11
48+
python-version: 3.12
4949
- run: python setup.py sdist
5050
- uses: actions/upload-artifact@v3
5151
with:
@@ -110,7 +110,7 @@ jobs:
110110
- uses: actions/checkout@v3
111111
- uses: actions/setup-python@v4
112112
with:
113-
python-version: 3.11
113+
python-version: 3.12
114114
- run: pip install -r requirements-doc.txt
115115
- run: pip install awscli
116116
- run: pip install -e .

Diff for: .github/workflows/tests-and-linters.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-20.04
1010
strategy:
1111
matrix:
12-
python-version: [2.7, 3.5, 3.6, 3.7, pypy2.7, pypy3.9]
12+
python-version: [3.7]
1313
steps:
1414
- uses: actions/checkout@v3
1515
- uses: actions/setup-python@v4
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
strategy:
2727
matrix:
28-
python-version: [3.8, 3.9, "3.10", 3.11]
28+
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
2929
steps:
3030
- uses: actions/checkout@v3
3131
- uses: actions/setup-python@v4
@@ -40,15 +40,16 @@ jobs:
4040
name: Run tests with coverage
4141
runs-on: ubuntu-latest
4242
env:
43-
DEPENDENCY_INJECTOR_DEBUG_MODE: 1
43+
# Cython's version <3 issue with tracing: "error: no member named 'use_tracing' in 'struct _PyCFrame'"
44+
# DEPENDENCY_INJECTOR_DEBUG_MODE: 1
4445
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
4546
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4647
steps:
4748
- uses: actions/checkout@v3
4849
- uses: actions/setup-python@v4
4950
with:
50-
python-version: 3.11
51-
- run: pip install tox cython
51+
python-version: 3.12
52+
- run: pip install tox cython==0.29.37
5253
- run: make cythonize
5354
- run: tox
5455
env:
@@ -64,7 +65,7 @@ jobs:
6465
- uses: actions/checkout@v3
6566
- uses: actions/setup-python@v4
6667
with:
67-
python-version: 3.11
68+
python-version: 3.12
6869
- run: pip install tox
6970
- run: tox
7071
env:

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,5 @@ src/dependency_injector/providers/*.so
7373

7474
# Workspace for samples
7575
.workspace/
76+
77+
.vscode/

0 commit comments

Comments
 (0)