grantjenks / blue

The slightly less uncompromising Python code formatter.
https://blue.readthedocs.io/
Other
387 stars 21 forks source link

Unable to run Blue formatting #81

Open gturbyne opened 2 years ago

gturbyne commented 2 years ago

Seems like I'm unable to get blue to run anymore...

I consistently get the following error: Traceback (most recent call last): File "/Users/gturbyne/workspace/sonarqube-tools/build/sonarqube-tools/environments/satellites/codeQuality/bin/blue", line 5, in <module> from blue import main File "/Users/gturbyne/workspace/sonarqube-tools/build/sonarqube-tools/environments/satellites/codeQuality/lib/python3.7/site-packages/blue/__init__.py", line 10, in <module> import black File "/Users/gturbyne/workspace/sonarqube-tools/build/sonarqube-tools/environments/satellites/codeQuality/lib/python3.7/site-packages/black/__init__.py", line 371, in <module> ) -> None: File "/Users/gturbyne/workspace/sonarqube-tools/build/sonarqube-tools/environments/satellites/python/lib/python3.7/site-packages/click/decorators.py", line 170, in decorator _param_memo(f, OptionClass(param_decls, **attrs)) File "/Users/gturbyne/workspace/sonarqube-tools/build/sonarqube-tools/environments/satellites/python/lib/python3.7/site-packages/click/core.py", line 1460, in __init__ Parameter.__init__(self, param_decls, type=type, **attrs) TypeError: __init__() got an unexpected keyword argument 'hidden' DURATION: 0.51s

grantjenks commented 2 years ago

Which version of blue is getting used here? And can you share the CLI args?

gturbyne commented 2 years ago

Hmm, looks like gradle is pulling in version 0.7.0 by default. Here is the full command that was run when I invoked the task: 'PYTHONDONTWRITEBYTECODE='1' PYTHONPATH='/Users/gturbyne/workspace/sonarqube-tools/build/sonarqube-tools/environments/venv/lib/python3.7/site-packages:/Users/gturbyne/workspace/sonarqube-tools/build/sonarqube-tools/environments/satellites/python/lib/python3.7/site-packages:/Users/gturbyne/workspace/sonarqube-tools/build/sonarqube-tools/environments/satellites/codeQuality/lib/python3.7/site-packages' /Users/gturbyne/workspace/sonarqube-tools/build/sonarqube-tools/environments/venv/bin/python /Users/gturbyne/workspace/sonarqube-tools/build/sonarqube-tools/environments/satellites/codeQuality/bin/blue --target-version py37 -l 120 /Users/gturbyne/workspace/sonarqube-tools/sonarqube-tools/src /Users/gturbyne/workspace/sonarqube-tools/sonarqube-tools/test'

warsaw commented 2 years ago

@gturbyne If you're using flake8 v5, Python 3.10, or Python 3.11 you probably want to use the latest version 0.9.1.

Ah, I see you're on Python 3.7, but still!

gturbyne commented 2 years ago

Hey @warsaw, I tried pulling in the latest version by adding it to my product-spec.json, and saw that the correct version was added into my build dir, however I’m still getting the same error.