diff --git a/.github/workflows/constraints.txt b/.github/workflows/constraints.txt index 2e35f828b..9b4a8179d 100644 --- a/.github/workflows/constraints.txt +++ b/.github/workflows/constraints.txt @@ -4,5 +4,5 @@ cutty==0.18.0 nox==2024.3.2 nox-poetry==1.0.3 poetry==1.8.2 -pre-commit==3.6.2 +pre-commit==3.7.0 virtualenv==20.25.1 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e420a13ca..6f724a971 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5.0.0 with: - python-version: "3.11" + python-version: "3.12" - run: | pip install --constraint=.github/workflows/constraints.txt pip pip install --constraint=.github/workflows/constraints.txt nox diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 174dfbd0b..29cf6e254 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5.0.0 with: - python-version: "3.11" + python-version: "3.12" - run: | pip install --constraint=.github/workflows/constraints.txt pip pip install --constraint=.github/workflows/constraints.txt pre-commit diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8075eff6e..3ab3d9f51 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,11 +12,11 @@ jobs: fail-fast: false matrix: include: + - { python-version: "3.12", os: ubuntu-latest } + - { python-version: "3.12", os: windows-latest } + - { python-version: "3.12", os: macos-latest } - { python-version: "3.11", os: ubuntu-latest } - - { python-version: "3.11", os: windows-latest } - - { python-version: "3.11", os: macos-latest } - { python-version: "3.10", os: ubuntu-latest } - - { python-version: "3.9", os: ubuntu-latest } name: Python ${{ matrix.python-version }} (${{ matrix.os }}) runs-on: ${{ matrix.os }} steps: @@ -96,7 +96,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5.0.0 with: - python-version: "3.11" + python-version: "3.12" - run: | pip install --constraint=.github/workflows/constraints.txt pip pip install --constraint=.github/workflows/constraints.txt nox diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a88844292..b4fc0826a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ Request features on the [Issue Tracker]. ## How to set up your development environment -You need Python 3.9+ and the following tools: +You need Python 3.10+ and the following tools: - [Cookiecutter] - [Poetry] diff --git a/README.md b/README.md index 0f4ba827d..9a10dff0a 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ cruft update - Generate command-line reference with [sphinx-click] - Manage project labels with [GitHub Labeler] -The template supports Python 3.9, 3.10 and 3.11. +The template supports Python 3.10, 3.10 and 3.12. [autodoc]: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html [black]: https://github.com/psf/black diff --git a/docs/guide.md b/docs/guide.md index 102e1c707..a4ea27974 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -103,12 +103,12 @@ py -VV Both of these commands should display the latest Python version, 3.10. For local testing with multiple Python versions, -repeat these steps for the latest bugfix releases of Python 3.9+, +repeat these steps for the latest bugfix releases of Python 3.10+, with the following changes: - Do _not_ enable the option to add Python to the `PATH` environment variable. - `py -VV` and `python -VV` should still display the version of the latest stable release. -- `py -X.Y -VV` (e.g. `py -3.7 -VV`) should display the exact version you just installed. +- `py -X.Y -VV` (e.g. `py -3.12 -VV`) should display the exact version you just installed. Note that binary installers are not provided for security releases. @@ -139,12 +139,12 @@ Install the Python build dependencies for your platform, using one of the commands listed in the [official instructions][pyenv wiki]. Install the latest point release of every supported Python version. -This project template supports Python 3.9, 3.10 and 3.11. +This project template supports Python 3.10, 3.11 and 3.12. ```console -pyenv install 3.9.18 pyenv install 3.10.13 pyenv install 3.11.6 +pyenv install 3.12.2 ``` After creating your project (see [below](creating-a-project)), @@ -152,12 +152,12 @@ you can make these Python versions accessible in the project directory, using the following command: ```console -pyenv local 3.11.6 3.10.13 3.9.18 +pyenv local 3.11.6 3.10.13 3.12.2 ``` The first version listed is the one used when you type plain `python`. Every version can be used by invoking `python`. -For example, use `python3.9` to invoke Python 3.9. +For example, use `python3.10` to invoke Python 3.10. ### Requirements @@ -980,13 +980,13 @@ for every Python version supported by your project, and easily switch between them: ```console -poetry env use 3.9 poetry env use 3.10 poetry env use 3.11 +poetry env use 3.12 ``` Only one Poetry environment can be active at any time. -Note that `3.11` comes last, +Note that `3.12` comes last, to ensure that the current Python release is the active environment. Install your package with `poetry install` into each environment after creating it. @@ -1185,39 +1185,35 @@ The following table gives an overview of the available Nox sessions: - Default - - [coverage](the-coverage-session) - Report coverage with [Coverage.py] - - `3.11` + - `3.10` - (✓) - - [docs](the-docs-session) - Build and serve [Sphinx] documentation - - `3.11` + - `3.10` - - - [docs-build](the-docs-build-session) - Build [Sphinx] documentation - - `3.11` + - `3.10` - ✓ - - [mypy](the-mypy-session) - Type-check with [mypy] - - `3.9` … `3.11` + - `3.10` … `3.12` - ✓ - - [pre-commit](the-pre-commit-session) - Lint with [pre-commit] - - `3.11` - - ✓ -- - [safety](the-safety-session) - - Scan dependencies with [Safety] - - `3.11` + - `3.10` - ✓ - - [tests](the-tests-session) - Run tests with [pytest] - - `3.9` … `3.11` + - `3.10` … `3.12` - ✓ - - [typeguard](the-typeguard-session) - Type-check with [Typeguard] - - `3.11` + - `3.10` - ✓ - - [xdoctest](the-xdoctest-session) - Run examples with [xdoctest] - - `3.9` … `3.11` + - `3.10` … `3.12` - ✓ ::: @@ -2264,28 +2260,25 @@ as shown in the table below: - Python versions - - [pre-commit](the-pre-commit-session) - Ubuntu - - 3.10 -- - [safety](the-safety-session) - - Ubuntu - - 3.10 + - 3.12 - - [mypy](the-mypy-session) - Ubuntu - - 3.10, 3.9, 3.8, 3.7 + - 3.10, 3.11, 3.12 - - [tests](the-tests-session) - Ubuntu - - 3.10, 3.9, 3.8, 3.7 + - 3.10, 3.11, 3.12 - - [tests](the-tests-session) - Windows - - 3.10 + - 3.12 - - [tests](the-tests-session) - macOS - - 3.10 + - 3.12 - - [coverage](the-coverage-session) - Ubuntu - - 3.10 + - 3.12 - - [docs-build](the-docs-build-session) - Ubuntu - - 3.10 + - 3.12 ::: diff --git a/docs/quickstart.md b/docs/quickstart.md index bea2c9b51..163cae91a 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -30,7 +30,7 @@ pipx inject nox nox-poetry [pipx] is preferred, but you can also install with `pip install --user`. -It is recommended to set up Python 3.9, 3.10 and 3.11 using [pyenv]. +It is recommended to set up Python 3.10, 3.11 and 3.12 using [pyenv]. ## Creating a project diff --git a/{{cookiecutter.project_name}}/.github/workflows/docs.yml b/{{cookiecutter.project_name}}/.github/workflows/docs.yml index bf131f019..ae47c751b 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/docs.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/docs.yml @@ -36,7 +36,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5.0.0 with: - python-version: "3.11" + python-version: "3.12" cache: "poetry" - name: Install dependencies diff --git a/{{cookiecutter.project_name}}/.github/workflows/release.yml b/{{cookiecutter.project_name}}/.github/workflows/release.yml index 5641179c1..1783367f4 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/release.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5.0.0 with: - python-version: "3.11" + python-version: "3.12" - name: Upgrade pip run: | diff --git a/{{cookiecutter.project_name}}/.github/workflows/tests.yml b/{{cookiecutter.project_name}}/.github/workflows/tests.yml index 0674594e2..271ff8390 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/tests.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/tests.yml @@ -16,17 +16,17 @@ jobs: matrix: include: - { python: "3.10", os: "ubuntu-latest", session: "pre-commit" } - - { python: "3.11", os: "ubuntu-latest", session: "mypy" } - { python: "3.10", os: "ubuntu-latest", session: "mypy" } - - { python: "3.9", os: "ubuntu-latest", session: "mypy" } - - { python: "3.11", os: "ubuntu-latest", session: "tests" } + - { python: "3.11", os: "ubuntu-latest", session: "mypy" } + - { python: "3.12", os: "ubuntu-latest", session: "mypy" } - { python: "3.10", os: "ubuntu-latest", session: "tests" } - - { python: "3.9", os: "ubuntu-latest", session: "tests" } - - { python: "3.11", os: "windows-latest", session: "tests" } - - { python: "3.11", os: "macos-latest", session: "tests" } - - { python: "3.10", os: "ubuntu-latest", session: "typeguard" } - - { python: "3.11", os: "ubuntu-latest", session: "xdoctest" } - - { python: "3.10", os: "ubuntu-latest", session: "docs-build" } + - { python: "3.11", os: "ubuntu-latest", session: "tests" } + - { python: "3.12", os: "ubuntu-latest", session: "tests" } + - { python: "3.12", os: "windows-latest", session: "tests" } + - { python: "3.12", os: "macos-latest", session: "tests" } + - { python: "3.12", os: "ubuntu-latest", session: "typeguard" } + - { python: "3.12", os: "ubuntu-latest", session: "xdoctest" } + - { python: "3.12", os: "ubuntu-latest", session: "docs-build" } env: NOXSESSION: ${{"{{"}} matrix.session {{"}}"}} @@ -122,7 +122,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5.0.0 with: - python-version: "3.11" + python-version: "3.12" - name: Upgrade pip run: | diff --git a/{{cookiecutter.project_name}}/CONTRIBUTING.md b/{{cookiecutter.project_name}}/CONTRIBUTING.md index 72e0ea4b8..76cba8cba 100644 --- a/{{cookiecutter.project_name}}/CONTRIBUTING.md +++ b/{{cookiecutter.project_name}}/CONTRIBUTING.md @@ -32,7 +32,7 @@ Request features on the [Issue Tracker]. ## How to set up your development environment -You need Python 3.9+ and the following tools: +You need Python 3.10+ and the following tools: - [Poetry] - [Nox] diff --git a/{{cookiecutter.project_name}}/noxfile.py b/{{cookiecutter.project_name}}/noxfile.py index 89113ea74..7e888d4df 100644 --- a/{{cookiecutter.project_name}}/noxfile.py +++ b/{{cookiecutter.project_name}}/noxfile.py @@ -23,7 +23,7 @@ raise SystemExit(dedent(message)) from None package = "{{cookiecutter.package_name}}" -python_versions = ["3.10", "3.11", "3.9"] +python_versions = ["3.10", "3.11", "3.12"] nox.needs_version = ">= 2021.6.6" nox.options.sessions = ( "pre-commit", diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 11dad755c..43d30bf2a 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -17,7 +17,7 @@ classifiers = ["{{cookiecutter.development_status}}"] Changelog = "https://github.com/{{cookiecutter.github_organization}}/{{cookiecutter.project_name}}/releases" [tool.poetry.dependencies] -python = "^3.9" +python = "^3.10" click = ">=8.0.1" [tool.poetry.group.dev.dependencies] @@ -75,7 +75,7 @@ show_error_context = true force-exclude = true # Apply excludes to pre-commit show-fixes = true src = ["src", "tests"] -target-version = "py39" # Minimum Python version supported +target-version = "py310" # Minimum Python version supported include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"] extend-exclude = [ "__pycache__",