From 4d2122a99c4e0fc209978ce29f7691e2b48488bc Mon Sep 17 00:00:00 2001 From: Jerry Pussinen Date: Wed, 13 Mar 2024 11:03:31 +0200 Subject: [PATCH] Add support for 3.10, 3.11 and 3.12. Ditch 3.7. Use 3.12 in CI by default. --- .github/workflows/test.yml | 6 +++--- .../.github/actions/python-poetry-env/action.yml | 2 +- .../.github/workflows/cookiecutter.yml | 2 +- {{cookiecutter.project_slug}}/.github/workflows/test.yml | 2 +- {{cookiecutter.project_slug}}/README.md | 2 +- {{cookiecutter.project_slug}}/pyproject.toml | 8 +++++--- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f431ccb..5bf50f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.12" - run: python -m pip install pre-commit - run: pre-commit run --all-files @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.12" - run: python -m pip install cookiecutter pytest pyyaml - run: pytest @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.12" - run: python -m pip install cookiecutter poetry - run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.21 - name: Generate project diff --git a/{{cookiecutter.project_slug}}/.github/actions/python-poetry-env/action.yml b/{{cookiecutter.project_slug}}/.github/actions/python-poetry-env/action.yml index 75edb2d..ab4ba5e 100644 --- a/{{cookiecutter.project_slug}}/.github/actions/python-poetry-env/action.yml +++ b/{{cookiecutter.project_slug}}/.github/actions/python-poetry-env/action.yml @@ -5,7 +5,7 @@ inputs: python-version: required: false description: 'Python version' - default: '3.10' + default: '3.12' outputs: {} runs: using: 'composite' diff --git a/{{cookiecutter.project_slug}}/.github/workflows/cookiecutter.yml b/{{cookiecutter.project_slug}}/.github/workflows/cookiecutter.yml index c4602c7..52acc01 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/cookiecutter.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/cookiecutter.yml @@ -12,7 +12,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.12" - name: Install dependencies run: python -m pip install cruft poetry jello tabulate diff --git a/{{cookiecutter.project_slug}}/.github/workflows/test.yml b/{{cookiecutter.project_slug}}/.github/workflows/test.yml index 3f73b16..27cf294 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/test.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 - uses: ./.github/actions/python-poetry-env diff --git a/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/README.md index 0591a4b..b9e22a2 100644 --- a/{{cookiecutter.project_slug}}/README.md +++ b/{{cookiecutter.project_slug}}/README.md @@ -29,7 +29,7 @@ pip install {{ cookiecutter.project_slug }} * Clone this repository * Requirements: * [Poetry](https://python-poetry.org/) - * Python 3.7+ + * Python 3.8+ * Create a virtual environment and install the dependencies ```sh diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 4fb7db8..5432123 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -18,9 +18,11 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed", ] @@ -30,7 +32,7 @@ packages = [ ] [tool.poetry.dependencies] -python = ">=3.7.1, <4.0" +python = ">=3.8.1, <4.0" [tool.poetry.dev-dependencies] autoflake = "*" @@ -65,7 +67,7 @@ profile = "black" src_paths = ["src", "tests"] [tool.black] -target-version = ["py37", "py38", "py39"] +target-version = ["py38", "py39", "py310", "py311", "py312"] include = '\.pyi?$' [tool.pytest.ini_options]