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

Bump pre-commit deps, to fix a breaking Click update #590

Merged
merged 5 commits into from
Apr 1, 2022

Conversation

DiddiLeija
Copy link
Collaborator

This fixes an issue with a breaking Click update.

See psf/black#2964 for full details.

This fixes an issue with a breaking Click update.
@DiddiLeija DiddiLeija changed the title Bump black from 22.1.0 to 22.3.0 Bump black from 22.1.0 to 22.3.0 on pre-commit Mar 28, 2022
@DiddiLeija
Copy link
Collaborator Author

DiddiLeija commented Mar 28, 2022

Ah... this crashed with something I didn't expect... pycln:

pycln....................................................................Failed
- hook id: pycln
- exit code: 1

Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repo4hw2hs9j/py_env-python3/bin/pycln", line 5, in <module>
    from pycln.cli import app
  File "/home/runner/.cache/pre-commit/repo4hw2hs9j/py_env-python3/lib/python3.9/site-packages/pycln/__init__.py", line 7, in <module>
    import typer
  File "/home/runner/.cache/pre-commit/repo4hw2hs9j/py_env-python3/lib/python3.9/site-packages/typer/__init__.py", line 12, in <module>
    from click.termui import get_terminal_size as get_terminal_size
ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/home/runner/.cache/pre-commit/repo4hw2hs9j/py_env-python3/lib/python3.9/site-packages/click/termui.py)
Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repo4hw2hs9j/py_env-python3/bin/pycln", line 5, in <module>
    from pycln.cli import app
  File "/home/runner/.cache/pre-commit/repo4hw2hs9j/py_env-python3/lib/python3.9/site-packages/pycln/__init__.py", line 7, in <module>
    import typer
  File "/home/runner/.cache/pre-commit/repo4hw2hs9j/py_env-python3/lib/python3.9/site-packages/typer/__init__.py", line 12, in <module>
    from click.termui import get_terminal_size as get_terminal_size
ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/home/runner/.cache/pre-commit/repo4hw2hs9j/py_env-python3/lib/python3.9/site-packages/click/termui.py)

@DiddiLeija DiddiLeija changed the title Bump black from 22.1.0 to 22.3.0 on pre-commit Bump pre-commit deps, to fix a breaking Click update Mar 28, 2022
I hope this will fix the last Click incompatibility.
@DiddiLeija
Copy link
Collaborator Author

Ah, I don't think upgrading pcln will fix anything... Maybe we should keep click pinned, to avoid issues.

Any thoughts @wntrblm/nox 1?

Footnotes

  1. Small note: I didn't expect this to be a big issue to fix, but seems like I had to open an issue first. Sorry :/

@DiddiLeija DiddiLeija closed this Mar 28, 2022
@DiddiLeija DiddiLeija deleted the black-and-click branch March 28, 2022 20:23
@DiddiLeija DiddiLeija restored the black-and-click branch March 28, 2022 20:24
@DiddiLeija DiddiLeija reopened this Mar 28, 2022
@DiddiLeija
Copy link
Collaborator Author

Ok, I reported this at hadialqattan/pycln#116. By now, I'll try to reduce Click to a lower version for running pycln.

This could be a temporary solution to the pycln issue.
@henryiii
Copy link
Collaborator

henryiii commented Mar 28, 2022

You can fix it by adding a cap on click inside the pycln environment. See https://github.com/pybind/pybind11/pull/3831/files. It's actually typer's fault in fastapi/typer#377, not pycln.

@DiddiLeija
Copy link
Collaborator Author

Good to hear that, thanks @henryiii!

@DiddiLeija
Copy link
Collaborator Author

I think this is ready now.

@DiddiLeija DiddiLeija requested a review from a team March 29, 2022 15:41
@DiddiLeija
Copy link
Collaborator Author

I see that Typer will get fixed soon (fastapi/typer#380). So, I think we can remove the Click downgrading and just upgrade some deps :)

@henryiii
Copy link
Collaborator

27 minutes ago, yes. :)

.pre-commit-config.yaml Outdated Show resolved Hide resolved
@tiangolo
Copy link

I just released Typer 0.4.1 that should handle it. 🚀 🤓

Typer has just fixed its issue :)
@DiddiLeija
Copy link
Collaborator Author

All done :)

@DiddiLeija
Copy link
Collaborator Author

I'm gonna merge this, since it looks like nobody disagrees :D

@DiddiLeija DiddiLeija merged commit 0fd600f into wntrblm:main Apr 1, 2022
@DiddiLeija DiddiLeija deleted the black-and-click branch April 11, 2022 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants