From c92129dcb02bec1e8e0156fdc271195aa4aef5e6 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Mon, 4 Nov 2024 00:01:28 -0500 Subject: [PATCH] Add support for Python 3.13 (#828) * Update tests pipeline and setup.py * Update tox coverage command * Add setuptools to the dev requirements file * Enforce coverage version in tox * Leave coveralls CI/CD job on Python 3.12 because coveralls 4.0.1 doesn't support Python 3.13 * Update changelog and publishing jobs --- .github/workflows/publishing.yml | 14 +++++++------- .github/workflows/tests-and-linters.yml | 4 ++-- docs/main/changelog.rst | 1 + requirements-dev.txt | 1 + setup.py | 1 + tox.ini | 8 ++++---- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml index 63247568..9fd7128a 100644 --- a/.github/workflows/publishing.yml +++ b/.github/workflows/publishing.yml @@ -15,11 +15,11 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: 3.12 + python-version: 3.13 - run: pip install tox - run: tox env: - TOXENV: 3.12 + TOXENV: 3.13 linters: name: Run linters @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: 3.12 + python-version: 3.13 - run: pip install tox - run: tox env: @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: 3.12 + python-version: 3.13 - run: | python -m pip install --upgrade pip setuptools python setup.py sdist @@ -61,7 +61,7 @@ jobs: matrix: os: [ubuntu-22.04, windows-2019, macos-14] env: - CIBW_SKIP: cp27-* cp313-* + CIBW_SKIP: cp27-* steps: - uses: actions/checkout@v3 - name: Build wheels @@ -75,7 +75,7 @@ jobs: needs: [tests, linters] runs-on: ubuntu-22.04 env: - CIBW_SKIP: cp27-* cp313-* + CIBW_SKIP: cp27-* steps: - uses: actions/checkout@v3 - name: Set up QEMU @@ -114,7 +114,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: 3.12 + python-version: 3.13 - run: pip install awscli - run: pip install -r requirements-doc.txt - run: pip install -e . diff --git a/.github/workflows/tests-and-linters.yml b/.github/workflows/tests-and-linters.yml index 2cd6e935..ce0345dd 100644 --- a/.github/workflows/tests-and-linters.yml +++ b/.github/workflows/tests-and-linters.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, "3.10", 3.11, 3.12] + python-version: [3.8, 3.9, "3.10", 3.11, 3.12, 3.13] steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 @@ -65,7 +65,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: 3.12 + python-version: 3.13 - run: pip install tox - run: tox env: diff --git a/docs/main/changelog.rst b/docs/main/changelog.rst index dae1e8b7..9bd3a904 100644 --- a/docs/main/changelog.rst +++ b/docs/main/changelog.rst @@ -9,6 +9,7 @@ follows `Semantic versioning`_ Develop -------- +- Add support for Python 3.13. - Migrate to Cython 3 (version 3.0.11). Many thanks to `ZipFile `_ for this contribution `#813 `_. diff --git a/requirements-dev.txt b/requirements-dev.txt index 413ad19c..9dbb9a7a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,5 @@ cython==3.0.11 +setuptools pytest pytest-asyncio tox diff --git a/setup.py b/setup.py index 3c4fdcd1..9047ff5c 100644 --- a/setup.py +++ b/setup.py @@ -111,6 +111,7 @@ setup(name="dependency-injector", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Framework :: AsyncIO", diff --git a/tox.ini b/tox.ini index dd634f02..65aa26f0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] parallel_show_output = true envlist= - coveralls, pylint, flake8, pydocstyle, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, pypy3.9, pypy3.10 + coveralls, pylint, flake8, pydocstyle, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, pypy3.9, pypy3.10 [testenv] deps= @@ -26,12 +26,12 @@ python_files = test_*_py3*.py [testenv:coveralls] passenv = GITHUB_*, COVERALLS_*, DEPENDENCY_INJECTOR_* -basepython=python3.12 +basepython=python3.12 # TODO: Upgrade to version 3.13 is blocked by coveralls 4.0.1 not supporting Python 3.13 deps= {[testenv]deps} cython>=3,<4 - coverage - coveralls + coverage>=7 + coveralls>=4 commands= coverage erase coverage run --rcfile=./.coveragerc -m pytest -c tests/.configs/pytest.ini