Skip to content

typing_extensions requirement inconsistency #5695

@minusf

Description

@minusf

It is claimed in the documentation and in pyproject.toml that typing_extensions is needed only for python>=3.10. However if plugins are enabled, beets crashes with ModuleNotFoundError: No module named 'typing_extensions'.

The plugins functionality is trying to import typing_extensions unconditionally.

I think it would be more user friendly and practical to have the same requirements as the official plugins. (requests is a similar plugin hidden dependency that needs to be added manually to a newly installed beets)

Now every time I update the venv or uv tool upgrade, I have to manually readd typing_extensions as it's being removed.

Would it be possible to either only import it conditionally, or declaring it in pyproject.toml so it's not being removed with every update?

Here is the string search for typing_extensions in the repo:
https://github.com/search?q=repo%3Abeetbox%2Fbeets%20typing_extensions&type=code

Problem

Running this command in verbose (-vv) mode:

$ beet

Led to this problem:

...
** error loading plugin edit:
Traceback (most recent call last):
  File "/Users/minusf/src/tmp/beetspip/venv/lib/python3.12/site-packages/beets/plugins.py", line 268, in load_plugins
    namespace = __import__(modname, None, None)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/minusf/src/tmp/beetspip/venv/lib/python3.12/site-packages/beetsplug/edit.py", line 27, in <module>
    from beets.importer import action
  File "/Users/minusf/src/tmp/beetspip/venv/lib/python3.12/site-packages/beets/importer.py", line 37, in <module>
    from beets.util import (
  File "/Users/minusf/src/tmp/beetspip/venv/lib/python3.12/site-packages/beets/util/pipeline.py", line 41, in <module>
    from typing_extensions import TypeVar, TypeVarTuple, Unpack
ModuleNotFoundError: No module named 'typing_extensions'

Setup

My configuration (output of beet config) is:

(paste here)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions