Skip to content

Commit 437300e

Browse files
authored
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
1 parent cc2304e commit 437300e

File tree

11 files changed

+1012
-996
lines changed

11 files changed

+1012
-996
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -47,8 +47,8 @@ jobs:
4747
- uses: actions/checkout@v3
4848
- uses: actions/setup-python@v4
4949
with:
50-
python-version: 3.11
51-
- run: pip install tox cython
50+
python-version: 3.12
51+
- run: pip install tox cython==0.29.36
5252
- run: make cythonize
5353
- run: tox
5454
env:
@@ -64,7 +64,7 @@ jobs:
6464
- uses: actions/checkout@v3
6565
- uses: actions/setup-python@v4
6666
with:
67-
python-version: 3.11
67+
python-version: 3.12
6868
- run: pip install tox
6969
- run: tox
7070
env:

.gitignore

Lines changed: 2 additions & 0 deletions
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/

requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cython==0.29.32
1+
cython==0.29.36
22
pytest
33
pytest-asyncio
44
tox
@@ -11,7 +11,7 @@ mypy
1111
pyyaml
1212
httpx
1313
fastapi
14-
pydantic
14+
pydantic==1.10.13
1515
numpy
1616
scipy
1717
boto3

requirements-doc.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# TODO: unpin 3.5.0 when this bug is fixed: https://github.com/sphinx-doc/sphinx/issues/8885
2-
sphinx<3.5.0
2+
sphinx
33

44
# TODO: unpin jinja2 after sphinx update to 4+
5-
jinja2<3.1
5+
jinja2
66

77
-e git+https://github.com/rmk135/sphinxcontrib-disqus.git#egg=sphinxcontrib-disqus
88

requirements-ext.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
flask
2-
aiohttp
1+
flask==2.1.3
2+
werkzeug==2.2.2
3+
aiohttp==3.9.0b1

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def _open(filename):
114114
"Programming Language :: Python :: 3.9",
115115
"Programming Language :: Python :: 3.10",
116116
"Programming Language :: Python :: 3.11",
117+
"Programming Language :: Python :: 3.12",
117118
"Programming Language :: Python :: Implementation :: CPython",
118119
"Programming Language :: Python :: Implementation :: PyPy",
119120
"Framework :: AsyncIO",

src/dependency_injector/_cwiring.c

Lines changed: 213 additions & 214 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dependency_injector/containers.c

Lines changed: 241 additions & 242 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dependency_injector/providers.c

Lines changed: 522 additions & 487 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/unit/providers/configuration/test_pydantic_settings_in_init_py36.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@
66

77

88
class Section11(pydantic.BaseModel):
9-
value1 = 1
9+
value1: int = 1
1010

1111

1212
class Section12(pydantic.BaseModel):
13-
value2 = 2
13+
value2: int = 2
1414

1515

1616
class Settings1(pydantic.BaseSettings):
17-
section1 = Section11()
18-
section2 = Section12()
17+
section1: Section11 = Section11()
18+
section2: Section12 = Section12()
1919

2020

2121
class Section21(pydantic.BaseModel):
22-
value1 = 11
23-
value11 = 11
22+
value1: int = 11
23+
value11: int = 11
2424

2525

2626
class Section3(pydantic.BaseModel):
27-
value3 = 3
27+
value3: int = 3
2828

2929

3030
class Settings2(pydantic.BaseSettings):
31-
section1 = Section21()
32-
section3 = Section3()
31+
section1: Section21 = Section21()
32+
section3: Section3= Section3()
3333

3434

3535
@fixture

0 commit comments

Comments
 (0)