Skip to content

Require typing_extensions on Python < 3.13#193

Open
stefanor wants to merge 1 commit into
beetbox:mainfrom
stefanor:dont-require-typing-extensions
Open

Require typing_extensions on Python < 3.13#193
stefanor wants to merge 1 commit into
beetbox:mainfrom
stefanor:dont-require-typing-extensions

Conversation

@stefanor
Copy link
Copy Markdown

@stefanor stefanor commented Feb 3, 2026

On newer Python releases, the typing module has all we need.

Fixes: #189

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 3, 2026

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@semohr
Copy link
Copy Markdown
Contributor

semohr commented May 14, 2026

Sorry for the delay!

Could you elaborate on the reasoning behind working around installing typing_extensions as a dependency?

From experience, version checks like the ones introduced in this PR tend to become brittle and harder to maintain over time. The typing_extensions package is specifically meant to handle these compatibility differences, so ideally we shouldn’t need to encode Python version logic in the codebase itself.

My preference would be to add typing_extensions as a dependency and rely on it to manage the compatibility layer, rather than maintaining custom version checks.

@stefanor
Copy link
Copy Markdown
Author

So, two things:

  1. typing_extensions was an undeclared dependency of confuse. Obviously undeclared dependencies are a problem.

I could just add it, but it wouldn't be needed on newer releases, so I changed the imports to be more future-focussed. As soon as you drop support for 3.13, you can drop the dependency (and simplify the imports).

If you just want a dependency on typing_extensions that's fine with me.

In Debian, we'll probably continue to carry the patch to use typing, because we don't need to support the older releases.

@semohr
Copy link
Copy Markdown
Contributor

semohr commented May 14, 2026

If it’s beneficial on your side, I don’t mind the version gated dependency too much here. From beets perspective, we already depend on typing_extensions unconditionally, so in practice it doesn’t make a difference for us either way.

Copy link
Copy Markdown
Contributor

@semohr semohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some small notes. The poetry lock needs an update too.

Comment thread confuse/core.py Outdated
Comment thread pyproject.toml Outdated
On newer Python releases, the typing module has all we need.

Fixes: beetbox#189
@stefanor stefanor force-pushed the dont-require-typing-extensions branch from 08f8e3b to 4f93c1e Compare May 14, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing runtime dependency: typing-extensions required but not declared

2 participants