From 6b55b7e1b60610736d6916213fb9f6c4cd91a5ea Mon Sep 17 00:00:00 2001 From: Katherine Whitlock Date: Fri, 17 Jan 2025 18:46:17 -0500 Subject: [PATCH] Replace references to Python 3.9 with Python 3.11 --- .github/workflows/ci-docker.yml | 2 +- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/release.yml | 2 +- .pre-commit-config.yaml | 2 +- pyproject.toml | 6 +++--- script/lint-python | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index b994cfaf17..64147e07b6 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -44,7 +44,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5.3.0 with: - python-version: "3.9" + python-version: "3.11" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.8.0 - name: Set up QEMU diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a344b177ae..a1bf810024 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,8 @@ permissions: contents: read env: - DEFAULT_PYTHON: "3.9" - PYUPGRADE_TARGET: "--py39-plus" + DEFAULT_PYTHON: "3.11" + PYUPGRADE_TARGET: "--py311-plus" concurrency: # yamllint disable-line rule:line-length @@ -172,10 +172,10 @@ jobs: fail-fast: false matrix: python-version: - - "3.9" - "3.10" - "3.11" - "3.12" + - "3.13" os: - ubuntu-latest - macOS-latest @@ -184,18 +184,18 @@ jobs: # Minimize CI resource usage # by only running the Python version # version used for docker images on Windows and macOS + - python-version: "3.13" + os: windows-latest - python-version: "3.12" os: windows-latest - python-version: "3.10" os: windows-latest - - python-version: "3.9" - os: windows-latest + - python-version: "3.13" + os: macOS-latest - python-version: "3.12" os: macOS-latest - python-version: "3.10" os: macOS-latest - - python-version: "3.9" - os: macOS-latest runs-on: ${{ matrix.os }} needs: - common diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 962bc66e94..20b97e9e40 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,7 +87,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5.3.0 with: - python-version: "3.9" + python-version: "3.11" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.8.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index adf0ac6fc2..44aed310ec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: rev: v3.15.2 hooks: - id: pyupgrade - args: [--py39-plus] + args: [--py311-plus] - repo: https://github.com/adrienverge/yamllint.git rev: v1.35.1 hooks: diff --git a/pyproject.toml b/pyproject.toml index 7789f6d645..300ab5c659 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ classifiers = [ "Programming Language :: Python :: 3", "Topic :: Home Automation", ] -requires-python = ">=3.9.0" +requires-python = ">=3.11.0" dynamic = ["dependencies", "optional-dependencies", "version"] @@ -52,7 +52,7 @@ version = {attr = "esphome.const.__version__"} include = ["esphome*"] [tool.black] -target-version = ["py39", "py310"] +target-version = ["py311", "py312"] exclude = 'generated' [tool.pytest.ini_options] @@ -65,7 +65,7 @@ addopts = [ ] [tool.pylint.MAIN] -py-version = "3.9" +py-version = "3.11" ignore = [ "api_pb2.py", ] diff --git a/script/lint-python b/script/lint-python index 01e5e76190..c046e2fb56 100755 --- a/script/lint-python +++ b/script/lint-python @@ -19,7 +19,7 @@ curfile = None def print_error(file, lineno, msg): - global curfile + global curfile # noqa PLW0603 if curfile != file: print_error_for_file(file, None) @@ -110,7 +110,7 @@ def main(): print_error(file_, linno, msg) errors += 1 - PYUPGRADE_TARGET = "--py39-plus" + PYUPGRADE_TARGET = "--py311-plus" cmd = ["pyupgrade", PYUPGRADE_TARGET] + files print() print("Running pyupgrade...")