Update pyproject and uv lock to fix missing typing_extensions dependency#47
Update pyproject and uv lock to fix missing typing_extensions dependency#47rohitrhmn1 wants to merge 1 commit intomdomke:mainfrom
typing_extensions dependency#47Conversation
| "Topic :: Software Development :: Libraries", | ||
| ] | ||
| dependencies = [ | ||
| "typing-extensions", |
There was a problem hiding this comment.
This dependency is very often conditional (on python version), to make use of features that are backported from the typing module in the most recent python version. Is this the case for this project?
There was a problem hiding this comment.
Here, in the latest versions of python-ulid, this package is imported somewhere and is not mentioned in the dependencies. Adding this in the package will solve the import issues.
For the sake of features that are backported, this project can mark minimum python version and use features for the recently available versions of python. Removing certain usages of this package inside the project will fix the problem.
|
To satisfy @merwok 's very reasonable request for this to be version dependent, we would need line 16 in from typing_extensions import Selfto: import sys
if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import SelfIt seems that the only thing imported from |
Conditionalize the import of `typing_extensions`, needed only in Python 3.10 and older; use `typing` instead for Python 3.11 and later. Add a dependency on `typing-extensions`, appropriately conditioned on the Python interpreter version. Based on mdomke#47 and mdomke#47 (comment). Fixes mdomke#44.
Conditionalize the import of `typing_extensions`, needed only in Python 3.10 and older; use `typing` instead for Python 3.11 and later. Add a dependency on `typing-extensions`, appropriately conditioned on the Python interpreter version. Based on mdomke#47 and mdomke#47 (comment). Fixes mdomke#44.
Fix missing
typing_extensionsdependencyThis PR updates
pyproject.tomlanduv.lockto explicitly includetyping_extensionsas a dependency.Changes
typing_extensionsto project dependencies inpyproject.tomluv.lockto reflect the new dependencyMotivation
The
typing_extensionspackage was being used in the codebase but not explicitly declared as a dependency, which could lead to import errors in certain environments where it's not already installed as a transitive dependency.This ensures the package will work reliably across all Python versions and installation scenarios.