Skip to content

Commit

Permalink
Add Python 3.12 Support (#752) (#765)
Browse files Browse the repository at this point in the history
* 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 <anton.a.petrov@gmail.com>
  • Loading branch information
rmk135 and anton-petrov authored Aug 7, 2024
1 parent 98d5867 commit a5166bf
Show file tree
Hide file tree
Showing 16 changed files with 1,098 additions and 1,075 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[run]
source = src/dependency_injector
source = dependency_injector
omit = tests/unit
plugins = Cython.Coverage

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
python-version: 3.12
- run: pip install tox
- run: tox
env:
TOXENV: 3.11
TOXENV: 3.12

linters:
name: Run linters
Expand All @@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
python-version: 3.12
- run: pip install tox
- run: tox
env:
Expand All @@ -45,7 +45,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
python-version: 3.12
- run: python setup.py sdist
- uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
python-version: 3.12
- run: pip install -r requirements-doc.txt
- run: pip install awscli
- run: pip install -e .
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/tests-and-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, pypy2.7, pypy3.9]
python-version: [3.7]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", 3.11]
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -40,15 +40,16 @@ jobs:
name: Run tests with coverage
runs-on: ubuntu-latest
env:
DEPENDENCY_INJECTOR_DEBUG_MODE: 1
# Cython's version <3 issue with tracing: "error: no member named 'use_tracing' in 'struct _PyCFrame'"
# DEPENDENCY_INJECTOR_DEBUG_MODE: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- run: pip install tox cython
python-version: 3.12
- run: pip install tox cython==0.29.37
- run: make cythonize
- run: tox
env:
Expand All @@ -64,7 +65,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
python-version: 3.12
- run: pip install tox
- run: tox
env:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ src/dependency_injector/providers/*.so

# Workspace for samples
.workspace/

.vscode/
Loading

0 comments on commit a5166bf

Please sign in to comment.