Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Click 8.1 changed the parameter order in click.Path #2235

Closed
timj opened this issue Mar 31, 2022 · 4 comments · Fixed by #2237
Closed

Click 8.1 changed the parameter order in click.Path #2235

timj opened this issue Mar 31, 2022 · 4 comments · Fixed by #2237
Milestone

Comments

@timj
Copy link

timj commented Mar 31, 2022

In #1962 (released as 8.1.x) the writable and readable parameters for the click.Path constructor changed order (and the executable parameter was not added at the end of the parameter list). This breaks code that was not using kwargs in the constructor.

See for example the breakage from lsst/daf_butler#669.

We have switched to kwargs. The API is not requiring that it only be used with kwargs and so we had not used kwargs previously.

Please consider using the * parameter in the APIs that are assumed to be kwargs only as this would enforce the policy.

Environment:

  • Python version: 3.8
  • Click version: 8.1.1
@davidism
Copy link
Member

davidism commented Mar 31, 2022

This was in the middle of a long list of arguments with no meaningful order, and with a clear fix (I expected people used kwargs already in this context). Using * consistently across the API required a minimum version of Python, and also requires a lot more compat code to migrate people over, so it's a longer term thing.

@timj
Copy link
Author

timj commented Mar 31, 2022

The order being clear or not was not really at issue because it was documented in that specific order in the existing API without any statement that kwargs was the only assumed calling paradigm. I realize that we should not have been relying on the order but nothing told us we should not be relying on it. Maybe we are the only click users who aren't using kwargs... 😄

@davidism
Copy link
Member

Hmm, I'll just put the parameter at the end until I can figure a better way to migrate to keyword-only args.

@davidism davidism reopened this Mar 31, 2022
@davidism davidism added this to the 8.1.2 milestone Mar 31, 2022
@davidism
Copy link
Member

Click 8.1.2 is available: https://pypi.org/project/click/8.1.2/

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants