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

Error with running black 21.8b0 on python 3.6: cannot import name 'TypeGuard' #2465

Closed
ilsurih opened this issue Aug 31, 2021 · 7 comments
Closed
Labels
T: bug Something isn't working

Comments

@ilsurih
Copy link

ilsurih commented Aug 31, 2021

Describe the bug

After 21.8b0 was released our py-3.6 CI started failing with the following error:
ImportError: cannot import name 'TypeGuard'

To Reproduce

Not sure what exactly can help to reproduce this. Comparing to previous run, the only changed version is black and importlib-metadata.

Expected behavior

NA, as it fails on startup

Environment (please complete the following information):
Using tox to install env, these are test dependencies:

flake8
flake8-black
flake8-bugbear
flake8-copyright
flake8-isort
pep8-naming
  • Version:3.6
  • OS and Python version: [Linux/Python 3.6] TBD

Does this bug also happen on main?

NA, as it is fails on startup

Additional context

typing-extensions released new patch for issue listed in changelog of 8b0: python/typing#865

Collecting typing-extensions>=3.6.4
  Downloading typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)

Our CI doesn't lock version, however build is still failing

Current workaround is to lock to 7b0 and build passes with that version

@ilsurih ilsurih added the T: bug Something isn't working label Aug 31, 2021
@felix-hilden felix-hilden added the R: invalid This issue / pull request doesn't seem right label Aug 31, 2021
@ilsurih ilsurih changed the title Eror Error with running black 21.8b0 on python 3.6: cannot import name 'TypeGuard' Aug 31, 2021
@felix-hilden
Copy link
Collaborator

felix-hilden commented Aug 31, 2021

I suspect this was submitted in error, so I'll close it. But feel free to edit the content and respond if you did have a bug that was bothering you!


Edit: I see you just changed the title, I'm following along if you have any details!

@felix-hilden felix-hilden reopened this Aug 31, 2021
@felix-hilden felix-hilden removed the R: invalid This issue / pull request doesn't seem right label Aug 31, 2021
@MarcoGorelli
Copy link
Contributor

MarcoGorelli commented Aug 31, 2021

@ilsurih how did you install black? pip install black should come with typing-extensions 3.10.x, which should have TypeGuard

@ilsurih
Copy link
Author

ilsurih commented Aug 31, 2021

@MarcoGorelli, @felix-hilden, sorry, submitted by mistake, let me finish writing description details

@ilsurih
Copy link
Author

ilsurih commented Aug 31, 2021

@MarcoGorelli, we are using tox to run tests and it installs typing-extensions 3.10.0.2

@MarcoGorelli
Copy link
Contributor

I can't reproduce this on Python3.6 with typing-extensions 3.10.0.2, black 21.8b0, and the flake8 plugins you listed. Could you share your tox.ini file?

@ilsurih
Copy link
Author

ilsurih commented Aug 31, 2021

I noticed that we are locking typing-extensions~=3.7.4 (comes from marshmallow-dataclass) and even if it installs latest version with black, it later reinstalls it back to 3.7.4.3:

2021-08-31T10:54:49.4395718Z Collecting typing-extensions>=3.6.4
2021-08-31T10:54:49.4544681Z Downloading typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)
...
2021-08-31T10:54:58.3922311Z lint-check installdeps: :ART:-...
2021-08-31T10:56:44.0560819Z lint-check installed: ...black==21.8b0,...,typeguard==2.12.1,typing-extensions==3.7.4.3...

So it appears 21.8b0 introduced a change that is no longer compatible with typing-extensions==3.7.4.3

@MarcoGorelli
Copy link
Contributor

MarcoGorelli commented Aug 31, 2021

Yes, 21.8b0 uses TypeGuard - that's why typing-extensions>=3.10.0.0 is required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants