From dc339328719b58eea98565194cb5b2c169979fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Wed, 5 Nov 2025 11:18:15 +0000 Subject: [PATCH] Update python version references --- .github/workflows/ci.yaml | 4 ++-- .github/workflows/integration_test.yaml | 6 +++++- .github/workflows/{lint.yml => lint.yaml} | 2 +- .github/workflows/make_release.yaml | 2 +- CONTRIBUTING.rst | 4 ++-- beets/plugins.py | 4 ---- beets/util/functemplate.py | 2 -- docs/changelog.rst | 5 +++++ docs/guides/installation.rst | 4 ++-- 9 files changed, 18 insertions(+), 15 deletions(-) rename .github/workflows/{lint.yml => lint.yaml} (99%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e8a532956..bfd05c718 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,10 +20,10 @@ jobs: fail-fast: false matrix: platform: [ubuntu-latest, windows-latest] - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] runs-on: ${{ matrix.platform }} env: - IS_MAIN_PYTHON: ${{ matrix.python-version == '3.9' && matrix.platform == 'ubuntu-latest' }} + IS_MAIN_PYTHON: ${{ matrix.python-version == '3.10' && matrix.platform == 'ubuntu-latest' }} steps: - uses: actions/checkout@v5 - name: Install Python tools diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml index 8c7e44d7a..375968571 100644 --- a/.github/workflows/integration_test.yaml +++ b/.github/workflows/integration_test.yaml @@ -3,6 +3,10 @@ on: workflow_dispatch: schedule: - cron: "0 0 * * SUN" # run every Sunday at midnight + +env: + PYTHON_VERSION: "3.10" + jobs: test_integration: runs-on: ubuntu-latest @@ -12,7 +16,7 @@ jobs: uses: BrandonLWhite/pipx-install-action@v1.0.3 - uses: actions/setup-python@v6 with: - python-version: 3.9 + python-version: ${{ env.PYTHON_VERSION }} cache: poetry - name: Install dependencies diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yaml similarity index 99% rename from .github/workflows/lint.yml rename to .github/workflows/lint.yaml index dcc5d0f12..bb54c8875 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yaml @@ -12,7 +12,7 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: "3.10" jobs: changed-files: diff --git a/.github/workflows/make_release.yaml b/.github/workflows/make_release.yaml index 5a8abe5bb..571b50970 100644 --- a/.github/workflows/make_release.yaml +++ b/.github/workflows/make_release.yaml @@ -8,7 +8,7 @@ on: required: true env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: "3.10" NEW_VERSION: ${{ inputs.version }} NEW_TAG: v${{ inputs.version }} diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index d19a376b3..c2cde4ed4 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -124,12 +124,12 @@ command. Instead, you can activate the virtual environment in your shell with: $ poetry shell -You should see ``(beets-py3.9)`` prefix in your shell prompt. Now you can run +You should see ``(beets-py3.10)`` prefix in your shell prompt. Now you can run commands directly, for example: :: - $ (beets-py3.9) pytest + $ (beets-py3.10) pytest Additionally, poethepoet_ task runner assists us with the most common operations. Formatting, linting, testing are defined as ``poe`` tasks in diff --git a/beets/plugins.py b/beets/plugins.py index 4fdad9807..810df3a45 100644 --- a/beets/plugins.py +++ b/beets/plugins.py @@ -25,7 +25,6 @@ from collections import defaultdict from functools import cached_property, wraps from importlib import import_module from pathlib import Path -from types import GenericAlias from typing import TYPE_CHECKING, Any, ClassVar, Literal, TypeVar import mediafile @@ -450,9 +449,6 @@ def _get_plugin(name: str) -> BeetsPlugin | None: for obj in reversed(namespace.__dict__.values()): if ( inspect.isclass(obj) - and not isinstance( - obj, GenericAlias - ) # seems to be needed for python <= 3.9 only and issubclass(obj, BeetsPlugin) and obj != BeetsPlugin and not inspect.isabstract(obj) diff --git a/beets/util/functemplate.py b/beets/util/functemplate.py index 5d85530a1..739196cef 100644 --- a/beets/util/functemplate.py +++ b/beets/util/functemplate.py @@ -105,8 +105,6 @@ def compile_func(arg_names, statements, name="_the_func", debug=False): decorator_list=[], ) - # The ast.Module signature changed in 3.8 to accept a list of types to - # ignore. mod = ast.Module([func_def], []) ast.fix_missing_locations(mod) diff --git a/docs/changelog.rst b/docs/changelog.rst index 64f69b792..906897015 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -7,6 +7,9 @@ below! Unreleased ---------- +Beets now requires Python 3.10 or later since support for EOL Python 3.9 has +been dropped. + New features: - :doc:`plugins/ftintitle`: Added argument for custom feat. words in ftintitle. @@ -42,6 +45,8 @@ For plugin developers: For packagers: +- The minimum supported Python version is now 3.10. + Other changes: - The documentation chapter :doc:`dev/paths` has been moved to the "For diff --git a/docs/guides/installation.rst b/docs/guides/installation.rst index 648a72d0b..bd634c4c5 100644 --- a/docs/guides/installation.rst +++ b/docs/guides/installation.rst @@ -1,10 +1,10 @@ Installation ============ -Beets requires `Python 3.9 or later`_. You can install it using package +Beets requires `Python 3.10 or later`_. You can install it using package managers, pipx_, pip_ or by using package managers. -.. _python 3.9 or later: https://python.org/download/ +.. _python 3.10 or later: https://python.org/download/ Using ``pipx`` or ``pip`` -------------------------