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

20.8b0 fails with __init__() got an unexpected keyword argument 'hidden' on Click older than 7.0 #1628

Closed
knkski opened this issue Aug 26, 2020 · 14 comments
Labels
T: bug Something isn't working

Comments

@knkski
Copy link

knkski commented Aug 26, 2020

Describe the bug

When I run black version 20.8b0 in Github Actions, it fails with this traceback:

Traceback (most recent call last):
  File "/usr/local/bin/black", line 7, in <module>
    from black import patched_main
  File "/usr/local/lib/python3.6/dist-packages/black/__init__.py", line 507, in <module>
    ) -> None:
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 170, in decorator
    _param_memo(f, OptionClass(param_decls, **attrs))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1460, in __init__
    Parameter.__init__(self, param_decls, type=type, **attrs)
TypeError: __init__() got an unexpected keyword argument 'hidden'

To Reproduce

  1. sudo pip3 install black
  2. black --check .
  3. See error

Expected behavior

Black would display any files that failed formatting check

Environment (please complete the following information):

  • Version: 20.8b0
  • OS and Python version: Default Github Actions image (Ubuntu 18.04/Python 3.6)
@knkski knkski added the T: bug Something isn't working label Aug 26, 2020
@knkski
Copy link
Author

knkski commented Aug 26, 2020

I'm not entirely sure, but it looks like the error is coming from this line:

hidden=True,

@ambv
Copy link
Collaborator

ambv commented Aug 26, 2020

We'll release a follow-up. In the mean time please pip3 install -U click to fix this.

@JelleZijlstra
Copy link
Collaborator

Looks like the option was new in Click 7.0. I'll send a PR to use that as the minimum requirement for Black.

@ambv ambv changed the title Black 20.8b0 traceback 20.8b0 fails with __init__() got an unexpected keyword argument 'hidden' on Click older than 7.0 Aug 26, 2020
@brysontyrrell
Copy link

+1 I also ran into sudden failures in GitHub actions when they pulled 20.8b0. I pinned the install to 19.10b0 to workaround.

@ambv
Copy link
Collaborator

ambv commented Aug 26, 2020

@brysontyrrell, try pinning Click to >=7.1.2 instead and see if that works for you.

@ambv
Copy link
Collaborator

ambv commented Aug 26, 2020

Released a hotfix 20.8b1 that addresses this. Please confirm.

knkski referenced this issue in canonical/microk8s Aug 26, 2020
@knkski
Copy link
Author

knkski commented Aug 26, 2020

Working for me. Thanks!

@knkski knkski closed this as completed Aug 26, 2020
@brysontyrrell
Copy link

brysontyrrell commented Aug 26, 2020

Still not working for me.

Oh no! 💥 💔 💥
14 files would be reformatted, 37 files would be left unchanged.
##[error]Process completed with exit code 1.

I re-ran and it pulled black 20.8b1 and click 7.1.2. Same versions of the packages locally don't encounter this. Maybe this is actually related to #1629 ?

@zsol
Copy link
Collaborator

zsol commented Aug 26, 2020

That looks like a different problem @brysontyrrell. I'm guessing you're running black --check and it would make formatting changes to your files (which is expected), so it exits with 1

@ambv
Copy link
Collaborator

ambv commented Aug 26, 2020

@brysontyrrell No, this is not related to #1629. The message you pasted tells you what's going on. This is a new version of an auto-formatter. The new version changed how it formats files. Commit the changes and you're good to go.

@brysontyrrell
Copy link

@ambv Thanks for clarifying. I had a caching issue locally that was causing 19.10 to be reinstalled and I wasn't catching it.

@bblommers
Copy link

@ambv The hotfix does not solve the issue for us. See https://travis-ci.org/github/spulec/moto/jobs/721404011

@ambv
Copy link
Collaborator

ambv commented Aug 26, 2020

@bblommers The logs on that Travis job tell you what's wrong. Namely the lines in the sdist step:

ERROR: black 20.8b1 has requirement click>=7.1.2, but you'll have click 6.7 which is incompatible.
ERROR: black 20.8b1 has requirement regex>=2020.1.8, but you'll have regex 2019.11.1 which is incompatible.

And why are you getting those? Because you request them explicitly here:
https://github.com/spulec/moto/blob/master/requirements-dev.txt#L16

(regex is on line 4 here)

@bblommers
Copy link

@ambv Well, that's awkward. I completely overlooked those lines! Thanks for the response

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

6 participants