Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing requirement of typing-extensions on python <= 3.10 #203

Closed
rokm opened this issue May 9, 2024 · 2 comments
Closed

Missing requirement of typing-extensions on python <= 3.10 #203

rokm opened this issue May 9, 2024 · 2 comments

Comments

@rokm
Copy link

rokm commented May 9, 2024

On python versions that do not provide typing.Self (i.e., python <= 3.10), schwifty falls back to using typing_extensions. However, it does not specify typing-extensions as a requirement, and consequently user installing schwifty in a clean virtual environment will end up with defunct version. For example, on linux:

python3.10 -m venv venv
. venv/bin/activate
pip install schwifty
python -c "import schwifty" 
Traceback (most recent call last):
  File "[...]/venv/lib64/python3.10/site-packages/schwifty/common.py", line 9, in <module>
    from typing import Self
ImportError: cannot import name 'Self' from 'typing' (/usr/lib64/python3.10/typing.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "[...]/venv/lib64/python3.10/site-packages/schwifty/__init__.py", line 6, in <module>
    from schwifty.bban import BBAN
  File "[...]/venv/lib64/python3.10/site-packages/schwifty/bban.py", line 5, in <module>
    from schwifty import common
  File "[...]/lib64/python3.10/site-packages/schwifty/common.py", line 11, in <module>
    from typing_extensions import Self
ModuleNotFoundError: No module named 'typing_extensions'
@rokm
Copy link
Author

rokm commented May 9, 2024

Looks like aa251c2 accidentally removed "typing_extensions>=4.0; python_version <= '3.11'" requirement that was added in #201.

@mdomke
Copy link
Owner

mdomke commented May 9, 2024

@rokm Thanks for the heads-up. I published a new release 2024.05.2 to address the issue.

@mdomke mdomke closed this as completed May 9, 2024
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

No branches or pull requests

2 participants