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

Python3.8 get_args failure #52

Closed
Rubio9 opened this issue Sep 22, 2020 · 5 comments
Closed

Python3.8 get_args failure #52

Rubio9 opened this issue Sep 22, 2020 · 5 comments

Comments

@Rubio9
Copy link

Rubio9 commented Sep 22, 2020

Getting the following error in the past two releases:

Traceback (most recent call last):
  File ".local/bin/instawow", line 5, in <module>
    from instawow.cli import main
  File ".local/lib/python3.8/site-packages/instawow/cli.py", line 33, in <module>
    from .resolvers import Defn, MultiPkgModel, Strategies
  File ".local/lib/python3.8/site-packages/instawow/resolvers.py", line 22, in <module>
    from typing_extensions import Literal, TypedDict, get_args
ImportError: cannot import name 'get_args' from 'typing_extensions' (.local/lib/python3.8/site-packages/typing_extensions.py)
Traceback (most recent call last):
  File ".local/bin/instawow", line 5, in <module>
    from instawow.cli import main
  File ".local/lib/python3.8/site-packages/instawow/cli.py", line 33, in <module>
    from .resolvers import Defn, MultiPkgModel, Strategies
  File ".local/lib/python3.8/site-packages/instawow/resolvers.py", line 22, in <module>
    from typing_extensions import Literal, TypedDict, get_args
ImportError: cannot import name 'get_args' from 'typing_extensions' (.local/lib/python3.8/site-packages/typing_extensions.py)

The error is here in resolvers.py:

 22 from typing_extensions import Literal, TypedDict, get_args

It looks like get_args (for Python 3.8+ anyway) is now in typing rather than typing_extensions.
This fixes it for me:

 22 from typing_extensions import Literal, TypedDict
 23 from typing import get_args
@layday
Copy link
Owner

layday commented Sep 22, 2020

What version of typing_extensions do you have installed?

@Rubio9
Copy link
Author

Rubio9 commented Sep 22, 2020

Instawow's self-updater pulled in 3.7.4.1 apparently.
.local/lib/python3.8/site-packages/typing_extensions-3.7.4.1.dist-info

from the updater run:
Requirement already satisfied, skipping upgrade: typing-extensions~=3.7 in ./.local/lib/python3.8/site-packages (from instawow) (3.7.4.1)

@layday
Copy link
Owner

layday commented Sep 22, 2020

typing-extensions is underspecified in our setup.py - you need version 3.7.4.2 or higher. I assume you're using pip (instawow does not come with its own updater). To update to the latest version of typing-extensions, use: python -m pip install -U typing-extensions.

@Rubio9
Copy link
Author

Rubio9 commented Sep 22, 2020

Ah. I see I magicked up a wrapper script and forgot about it. Yes, it's using pip3 to manage updates.
After updating typing-extensions to 3.7.4.3 the error is gone.
Thank you!
Consider this a request to better specify the versioning requirement for typing-extensions :)

@layday
Copy link
Owner

layday commented Sep 22, 2020

The main branch no longer makes use of get_args but I should pay closer attention to dependency specification. Thank you for the report.

@layday layday closed this as completed Sep 22, 2020
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