fix: conditional Self import depending on python version - #111
Merged
Conversation
from typing in >=3.11, else from typing_extensions, added as <3.11 dependency
GitBib
approved these changes
May 1, 2026
GitBib
left a comment
Owner
There was a problem hiding this comment.
Thanks for the quick fix! Verified the bug reproduces on Python 3.10 with a no-dev install and that this PR resolves it on both 3.10 (typing-extensions installed via marker) and 3.11+ (uses stdlib typing.Self, no extra dep).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #111 +/- ##
=======================================
Coverage 99.11% 99.11%
=======================================
Files 21 21
Lines 1472 1475 +3
=======================================
+ Hits 1459 1462 +3
Misses 13 13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #110
Notes
Tested for:
uv run --no-dev --python 3.10 python -c "import pymkv"uv run --no-dev --python 3.11 python -c "import pymkv"I don't think we can implement actual tests because
typing-extensionis always present in dev runtimes.Could use dedicated tools though, like deptry.