black being pinned to an older version causes a crash
See original GitHub issueThere was a breaking change recently in the click
library which is a dependency in black
. black
has updated the dependency version and released a new version, however because black
is pinned to an older version, this fix isn’t getting propagated. For the moment, we can workaround this by pinning click
to an older version, but I think nbqa-black
itself can fix this by moving to the newest black version.
I checked the commit that introduced the version pin, but I couldn’t figure out the reason for doing so.
Refer to the upstream issue for more details.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Recurring Crash to Black Screen - Microsoft Community
Symptoms : I have crash that occurs pretty frequently on my machine. When it occurs the screen goes almost completely black, filling with ......
Read more >[Solved] Kernel Power 41 Critical Error on Windows 11/10
Mostly, the Kernel-Power 41 error is caused by the wrong device drivers on your computer, especially an old or corrupted sound card driver....
Read more >5700 xt black screen crash !!! - AMD Community
First, the screens goes black , then keyboard and mouse goes off , but pc still running but freezed , i have to...
Read more >Here's Why Windows 10 Crashes On Lenovo Laptops
Microsoft has discovered the source of a mysterious bug that is causing Windows 10 to hang on Lenovo laptops.
Read more >Latest Troubleshooting FAQ (1.0.8.3) :: Distant Worlds 2 Tech ...
If you cannot get the game working with the latest version, there is the option of going back to the previous Legacy branches...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, run into an issue while testing
nbqa black
for the first time today. Want to check first if it is related to this one.I was trying to run this tools against a notebook I have, my setup is a windows laptop with docker, and I pulled
python:3.6
from dockerhub, started an interactive container with my code mounted as a volume.Then, created a virtual environment and installed nbqa as:
In line 3 above, nbqa complained that the “black” command was not found. I thought those tools described in https://nbqa.readthedocs.io/en/latest/examples.html came pre-packaged with nbqa 😃, so I installed black with pip. Then trying to run it, gave me this error (the traces are shortened):
And my black version was:
~I will try to install black 22.3.0 and run again~ Same error with black==22.3.0
UPDATE: my bad, this error is related to Python 3.6. https://stackoverflow.com/a/53209196 explains the reason.
Using a python:3.7 as the container image, got the thing working:
@chamilad black fixed this issue by now. The hook from nbqa does not pin the back version https://github.com/nbQA-dev/nbQA/blob/b77ee1424b4ef11878c99ebd8a701ed442fa0aa8/.pre-commit-hooks.yaml#L8-L15 But
pre-commit
caches the venvs it uses to run the hooks based on the values in your config. Your problem most likely is that the cached venv uses a broken combination ofback
andclick
(also had this issue lately). You could just pin the version ofblack==22.3.0
in theadditional_dependencies
section of yourpre-commit-config.yaml
, which would create a new venv due to the changed config. Alternatively, if black isn’t pinned in your config you can runpre-commit clean
which will delete all cached venvs.@MarcoGorelli The possibility to create such a broken venv with the default
nbqa
hook was less than 1 day (breaking click release, fixing black release). The only possibility to end up with a brokenpre-commit
config now is if users pin an older black version in theiradditional_dependencies
, in which case there is nothing that could be done from the side ofnbqa
since the hooksadditional_dependencies
section will be overwritten. Maybe just rename this issue and pin it for a month or so?