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

Our import of FC,F from click.decorators isn't supported #726

Closed
ggainey opened this issue Jul 18, 2023 · 2 comments · Fixed by #745
Closed

Our import of FC,F from click.decorators isn't supported #726

ggainey opened this issue Jul 18, 2023 · 2 comments · Fixed by #745
Assignees
Labels
bug Something isn't working (template-set)

Comments

@ggainey
Copy link
Contributor

ggainey commented Jul 18, 2023

In pulpcore/cli/common/generic.py we do from click.decorators import FC, F. These are "convenient aliases", not part of click's supported API, and one of them "disappeared" in click-8.1.4. We need to not-rely on importing from click.

@ggainey ggainey added bug Something isn't working (template-set) Triage-Needed Needs to be reviewed at next pulp-cli mtg labels Jul 18, 2023
@mdellweg mdellweg removed the Triage-Needed Needs to be reviewed at next pulp-cli mtg label Jul 18, 2023
@ggainey ggainey self-assigned this Jul 18, 2023
@ggainey
Copy link
Contributor Author

ggainey commented Jul 18, 2023

Note: a quick experiment shows that click-8.1.5 still gives us lint failures:

(oci-env) (726_click-8-1-5) ~/github/Pulp3/pulp-cli $ pip freeze | grep mypy
mypy==1.4.1
mypy-extensions==1.0.0
(oci-env) (726_click-8-1-5) ~/github/Pulp3/pulp-cli $ make lint
mypy
pulpcore/cli/common/generic.py:1080: error: Argument 1 has incompatible type "Callable[[Arg(PulpCLIContext, 'pulp_ctx'), Arg(PulpEntityContext, 'entity_ctx'), Arg(int, 'limit'), Arg(int, 'offset'), KwArg(Any)], None]"; expected "Callable[[PulpCLIContext, Arg(PulpEntityContext, 'entity_ctx'), Arg(int, 'limit'), Arg(int, 'offset'), KwArg(Any)], None]"  [arg-type]
pulpcore/cli/common/generic.py:1080: note: This is likely because "callback" has named arguments: "pulp_ctx". Consider marking them positional-only
pulpcore/cli/common/generic.py:1080: error: Argument 1 has incompatible type "Callable[[Arg(PulpEntityContext, 'entity_ctx'), Arg(int, 'limit'), Arg(int, 'offset'), KwArg(Any)], None]"; expected "Callable[[PulpEntityContext, Arg(int, 'limit'), Arg(int, 'offset'), KwArg(Any)], None]"  [arg-type]
pulpcore/cli/common/generic.py:1080: note: This is likely because "None" has named arguments: "entity_ctx". Consider marking them positional-only

I think we want to wait for click-8.1.6; see pallets/click#2558 (comment) and pallets/click#2565 for community discussion.

mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 20, 2023
@mdellweg mdellweg self-assigned this Jul 20, 2023
mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 20, 2023
mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 20, 2023
mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 20, 2023
mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 20, 2023
mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 20, 2023
mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 20, 2023
@ggainey
Copy link
Contributor Author

ggainey commented Jul 21, 2023

We're also running into python/mypy#15037 , which @mdellweg is addressing in the PR for this issue.

mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 21, 2023
mdellweg added a commit that referenced this issue Jul 24, 2023
mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working (template-set)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants