From cb2638818703b5caff008b95b8dd6b1d3144f816 Mon Sep 17 00:00:00 2001 From: MaxymVlasov Date: Tue, 18 Nov 2025 16:11:38 +0200 Subject: [PATCH 1/4] chore: Drop EOL Python 3.9 and macos-13 --- .github/workflows/ci-cd.yml | 6 +-- .mypy.ini | 2 +- .pre-commit-config.yaml | 60 +++++++++++++++--------------- pyproject.toml | 3 +- ruff.toml | 4 +- src/pre_commit_terraform/_types.py | 4 +- 6 files changed, 39 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index c57b87bf8..2efb5ade9 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -453,17 +453,17 @@ jobs: # NOTE: The latest and the lowest supported Pythons are prioritized # NOTE: to improve the responsiveness. It's nice to see the most # NOTE: important results first. - - 3.13 - - 3.9 + - 3.14 # str - >- 3.10 + - 3.13 - 3.12 - 3.11 runner-vm-os: - ubuntu-24.04 - macos-14 - - macos-13 + - macos-15-intel - windows-2025 toxenv: - pytest diff --git a/.mypy.ini b/.mypy.ini index a92387a64..b5c7808b9 100644 --- a/.mypy.ini +++ b/.mypy.ini @@ -1,5 +1,5 @@ [mypy] -python_version = 3.9 +python_version = 3.10 color_output = true error_summary = true # IMPORTANT: The file list MUST NOT have a trailing comma after the last entry. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1b28af60c..c15a5d27e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -121,53 +121,53 @@ repos: rev: 9f70dc58c23dfcca1b97af99eaeee3140a807c7e # frozen: v1.18.2 hooks: - id: mypy - alias: mypy-py313 - name: MyPy, for Python 3.13 + alias: mypy-py314 + name: MyPy, for Python 3.14 additional_dependencies: - lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report` - pytest - pytest-mock args: - - --python-version=3.13 - - --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.13 - - --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.13 - - --html-report=.tox/.tmp/.test-results/mypy--py-3.13 - - --linecount-report=.tox/.tmp/.test-results/mypy--py-3.13 - - --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.13 - - --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.13 - - --txt-report=.tox/.tmp/.test-results/mypy--py-3.13 + - --python-version=3.14 + - --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.14 + - --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.14 + - --html-report=.tox/.tmp/.test-results/mypy--py-3.14 + - --linecount-report=.tox/.tmp/.test-results/mypy--py-3.14 + - --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.14 + - --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.14 + - --txt-report=.tox/.tmp/.test-results/mypy--py-3.14 pass_filenames: false - id: mypy - alias: mypy-py311 - name: MyPy, for Python 3.11 + alias: mypy-py312 + name: MyPy, for Python 3.12 additional_dependencies: - lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report` - pytest - pytest-mock args: - - --python-version=3.11 - - --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.11 - - --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.11 - - --html-report=.tox/.tmp/.test-results/mypy--py-3.11 - - --linecount-report=.tox/.tmp/.test-results/mypy--py-3.11 - - --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.11 - - --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.11 - - --txt-report=.tox/.tmp/.test-results/mypy--py-3.11 + - --python-version=3.12 + - --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.12 + - --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.12 + - --html-report=.tox/.tmp/.test-results/mypy--py-3.12 + - --linecount-report=.tox/.tmp/.test-results/mypy--py-3.12 + - --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.12 + - --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.12 + - --txt-report=.tox/.tmp/.test-results/mypy--py-3.12 pass_filenames: false - id: mypy - alias: mypy-py39 - name: MyPy, for Python 3.9 + alias: mypy-py310 + name: MyPy, for Python 3.10 additional_dependencies: - lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report` - pytest - pytest-mock args: - - --python-version=3.9 - - --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.9 - - --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.9 - - --html-report=.tox/.tmp/.test-results/mypy--py-3.9 - - --linecount-report=.tox/.tmp/.test-results/mypy--py-3.9 - - --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.9 - - --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.9 - - --txt-report=.tox/.tmp/.test-results/mypy--py-3.9 + - --python-version=3.10 + - --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.10 + - --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.10 + - --html-report=.tox/.tmp/.test-results/mypy--py-3.10 + - --linecount-report=.tox/.tmp/.test-results/mypy--py-3.10 + - --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.10 + - --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.10 + - --txt-report=.tox/.tmp/.test-results/mypy--py-3.10 pass_filenames: false diff --git a/pyproject.toml b/pyproject.toml index afef00e9d..4a81bc897 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,6 @@ classifiers = [ 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', @@ -43,7 +42,7 @@ dynamic = [ 'urls', 'version', ] -requires-python = ">= 3.9" +requires-python = ">= 3.10" [[project.authors]] name = 'Anton Babenko' diff --git a/ruff.toml b/ruff.toml index 0e57620ea..aba0d1da2 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,5 +1,5 @@ -# Assume Python 3.9 -target-version = "py39" +# Assume Python 3.10 +target-version = "py310" line-length = 79 # To decrease PR diff size diff --git a/src/pre_commit_terraform/_types.py b/src/pre_commit_terraform/_types.py index 69f71e690..9d062afbf 100644 --- a/src/pre_commit_terraform/_types.py +++ b/src/pre_commit_terraform/_types.py @@ -2,12 +2,12 @@ from argparse import ArgumentParser, Namespace from collections.abc import Callable -from typing import Protocol, Union +from typing import Protocol from ._structs import ReturnCode -ReturnCodeType = Union[ReturnCode, int] # Union instead of pipe for Python 3.9 +ReturnCodeType = ReturnCode | int CLIAppEntryPointCallableType = Callable[[Namespace], ReturnCodeType] From a5a85186643d1de894d5618c5081e9ac4dfe0c5a Mon Sep 17 00:00:00 2001 From: MaxymVlasov Date: Tue, 18 Nov 2025 16:15:18 +0200 Subject: [PATCH 2/4] f --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 4a81bc897..8bcc4f992 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ classifiers = [ 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', ] From 5b9ce172fe24bbc0a574b8c016101354c7112800 Mon Sep 17 00:00:00 2001 From: Maksym Vlasov Date: Tue, 18 Nov 2025 17:01:16 +0200 Subject: [PATCH 3/4] Apply suggestions from code review --- .github/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 2efb5ade9..58f2d6e28 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -462,7 +462,7 @@ jobs: - 3.11 runner-vm-os: - ubuntu-24.04 - - macos-14 + - macos-15 - macos-15-intel - windows-2025 toxenv: From 34b3f5a3a63f904886aa13ef46d4687c85e61576 Mon Sep 17 00:00:00 2001 From: Maksym Vlasov Date: Thu, 20 Nov 2025 14:12:34 +0200 Subject: [PATCH 4/4] Update ruff.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- ruff.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/ruff.toml b/ruff.toml index aba0d1da2..10a18fb0f 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,6 +1,3 @@ -# Assume Python 3.10 -target-version = "py310" - line-length = 79 # To decrease PR diff size namespace-packages = ["src/pre_commit_terraform/", "tests/pytest/"]