From b8c669cda26d3f395ec860c9e0dc1c8b03ab4e13 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:10:17 +0200 Subject: [PATCH] DX: only support Python 3.12 (#90) * MAINT: remove GitPod configuration --- .cspell.json | 1 - .github/workflows/ci.yml | 2 ++ .gitpod.yml | 32 ---------------------------- .pre-commit-config.yaml | 2 ++ create-pytest-matrix/main.py | 7 ++++-- create-python-version-matrix/main.py | 2 -- environment.yml | 2 +- get-pre-commit-taplo-version/main.py | 2 -- get-pypi-name/main.py | 2 -- get-skipped-pre-commit-hooks/main.py | 2 -- pyproject.toml | 10 +++------ 11 files changed, 13 insertions(+), 51 deletions(-) delete mode 100644 .gitpod.yml diff --git a/.cspell.json b/.cspell.json index d19b3b29..05285d80 100644 --- a/.cspell.json +++ b/.cspell.json @@ -36,7 +36,6 @@ "**/.cspell.json", ".editorconfig", ".gitignore", - ".gitpod.*", ".pre-commit-config.yaml", ".prettierignore", ".vscode/*", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0163c6d..c5374296 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,3 +32,5 @@ jobs: secrets: token: ${{ secrets.PAT }} uses: ComPWA/actions/.github/workflows/pre-commit.yml@v1 + with: + python-version: "3.12" diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index 52c75ddc..00000000 --- a/.gitpod.yml +++ /dev/null @@ -1,32 +0,0 @@ -tasks: - - init: pyenv local 3.9 - - init: pip install -e .[dev] - -github: - prebuilds: - master: true - branches: false - pullRequests: true - pullRequestsFromForks: true - addComment: false - addBadge: false - addLabel: false - -vscode: - extensions: - - charliermarsh.ruff - - christian-kohler.path-intellisense - - eamodio.gitlens - - editorconfig.editorconfig - - esbenp.prettier-vscode - - github.vscode-github-actions - - github.vscode-pull-request-github - - mhutchie.git-graph - - ms-python.python - - redhat.vscode-yaml - - soulcode.vscode-unwanted-extensions - - stkb.rewrap - - streetsidesoftware.code-spell-checker - - tamasfe.even-better-toml - - trentrand.git-commit-helper-vscode - - yzhang.markdown-all-in-one diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bbdd6e40..6c465393 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,7 +55,9 @@ repos: args: - --allow-deprecated-workflows - --dependabot=update + - --dev-python-version=3.12 - --keep-pr-linting + - --no-gitpod - --no-notebooks - --no-prettierrc - --no-pypi diff --git a/create-pytest-matrix/main.py b/create-pytest-matrix/main.py index 6456123d..3d0fa0fb 100644 --- a/create-pytest-matrix/main.py +++ b/create-pytest-matrix/main.py @@ -6,10 +6,13 @@ import os from argparse import ArgumentParser from configparser import ConfigParser -from typing import Sequence +from typing import TYPE_CHECKING import toml +if TYPE_CHECKING: + from collections.abc import Sequence + def main(argv: Sequence[str] | None = None) -> int: parser = ArgumentParser(__doc__) @@ -54,7 +57,7 @@ def create_job_matrix( # noqa: C901 msg = ( f"Selected Python {coverage_python_version} for the coverage job, but" " the package only supports Python" - f" {', '.join(supported_python_versions)}" + f" {", ".join(supported_python_versions)}" ) raise ValueError(msg) if coverage_python_version in python_versions: diff --git a/create-python-version-matrix/main.py b/create-python-version-matrix/main.py index de5eb29b..64009e76 100644 --- a/create-python-version-matrix/main.py +++ b/create-python-version-matrix/main.py @@ -1,7 +1,5 @@ """Print job matrix for a GitHub Actions workflow that runs `pytest`.""" -from __future__ import annotations - import json import os from configparser import ConfigParser diff --git a/environment.yml b/environment.yml index 4e643a8f..ce392399 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: compwa-actions channels: - defaults dependencies: - - python==3.9.* + - python==3.12.* - pip - pip: - -e .[dev] diff --git a/get-pre-commit-taplo-version/main.py b/get-pre-commit-taplo-version/main.py index 6a8c0030..9a6ad91e 100644 --- a/get-pre-commit-taplo-version/main.py +++ b/get-pre-commit-taplo-version/main.py @@ -1,7 +1,5 @@ """Print job matrix for a GitHub Actions workflow that runs `pytest`.""" -from __future__ import annotations - import os import yaml diff --git a/get-pypi-name/main.py b/get-pypi-name/main.py index ed76a82d..467280b2 100644 --- a/get-pypi-name/main.py +++ b/get-pypi-name/main.py @@ -1,7 +1,5 @@ """Print job matrix for a GitHub Actions workflow that runs `pytest`.""" -from __future__ import annotations - import os from configparser import ConfigParser diff --git a/get-skipped-pre-commit-hooks/main.py b/get-skipped-pre-commit-hooks/main.py index 5b7de144..696d59bf 100644 --- a/get-skipped-pre-commit-hooks/main.py +++ b/get-skipped-pre-commit-hooks/main.py @@ -1,7 +1,5 @@ """Print job matrix for a GitHub Actions workflow that runs `pytest`.""" -from __future__ import annotations - import os import yaml diff --git a/pyproject.toml b/pyproject.toml index 9e9133b1..0a58e8a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,11 +9,7 @@ classifiers = [ "Intended Audience :: Developers", "Natural Language :: English", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.12", "Programming Language :: Python", ] dependencies = ["toml"] @@ -21,7 +17,7 @@ description = "Python scripts used by the ComPWA/actions repository" dynamic = ["version"] license = {text = "License :: OSI Approved :: MIT License"} name = "compwa-actions" -requires-python = ">=3.7" +requires-python = ">=3.12" [project.optional-dependencies] dev = [ @@ -55,7 +51,7 @@ typeCheckingMode = "strict" [tool.ruff] preview = true show-fixes = true -target-version = "py37" +target-version = "py312" [tool.ruff.format] docstring-code-format = true