Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[pre-commit] black version #4506

Merged
merged 4 commits into from
Apr 20, 2022
Merged

[pre-commit] black version #4506

merged 4 commits into from
Apr 20, 2022

Conversation

jxmsML
Copy link
Contributor

@jxmsML jxmsML commented Apr 20, 2022

Patch description

In running pre-commit hook, one might run into the following error:

black....................................................................Failed
- hook id: black
- exit code: 1
Traceback (most recent call last):
File "/private/home/edinan/.cache/pre-commit/reporz51shde/py_env-python3/bin/black", line 8, in <module>
sys.exit(patched_main())
File "/private/home/edinan/.cache/pre-commit/reporz51shde/py_env-python3/lib/python3.8/site-packages/black.py", line 3753, in patched_main
patch_click()
File "/private/home/edinan/.cache/pre-commit/reporz51shde/py_env-python3/lib/python3.8/site-packages/black.py", line 3742, in patch_click
from click import _unicodefun # type: ignore
ImportError: cannot import name '_unicodefun' from 'click' (/private/home/edinan/.cache/pre-commit/reporz51shde/py_env-python3/lib/python3.8/site-packages/click/__init__.py)
git-secrets..............................................................Passed

This is due to the fact that black version before 22.3.0 won't work with click>=8.1.0 (see https://l.workplace.com/l.php?u=https%3A%2F%2Fgithub.com%2Fpsf%2Fblack%2Fissues%2F2964&h=AT2D2RfKmHXQkTwfYZw2USSuOmioZV507dYGfbP2P2kpFXCW-tu0mjxCiOLduxb549xZDeqbp0OjF4gTBe9s23vAr3yUfK9TR0sqSu_zHpQcP7ypcuzU5kA2i_wDebMOo5L_L4uXGjPcOrJo2cGMY5ZLu2eRkx0vIJCc&__tn__=-UK-R&c[0]=AT2a7FL9uX5KXig9Q6tYmBNYQ-hqfwmSksT3xE8uNsv3xRQ4Ch9MdOmVL4NnYNa3yZc-1ln94aW0PynLWjQfdibF24sSS4oV-dUKpEl1rZJuoQnHDgl_B-EzapetqH-vGVXoAJh3fer_SgVrff8qRozz5zr8)

Thanks to @emilydinan for this proposed solution.

Testing steps

CI pre-commit

Other information

@jxmsML jxmsML merged commit 3192501 into main Apr 20, 2022
@jxmsML jxmsML deleted the black_2230 branch April 20, 2022 16:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants