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

Kedro CLI displays description for all installed plugins #1749

Closed
deepyaman opened this issue Aug 3, 2022 · 6 comments · Fixed by kedro-org/kedro-viz#1001
Closed

Kedro CLI displays description for all installed plugins #1749

deepyaman opened this issue Aug 3, 2022 · 6 comments · Fixed by kedro-org/kedro-viz#1001
Labels
Component: CLI Issue/PR that addresses the CLI for Kedro Issue: Bug Report 🐞 Bug that needs to be fixed

Comments

@deepyaman
Copy link
Member

Description

If you install Kedro plugins, their descriptions show up in description when you do kedro -h.

Context

How has this bug affected you? What were you trying to accomplish?

I was testing a new plugin I was writing, noticed the behavior, and didn't like it. :)

Steps to Reproduce

  1. pip install kedro-docker
  2. kedro new (and go through the prompt)
  3. kedro -h

Expected Result

Tell us what should happen.

"Kedro plugin for packaging a project with Docker" shouldn't be in there.

Actual Result

Tell us what happens instead.

Usage: kedro [OPTIONS] COMMAND [ARGS]...

  Kedro is a CLI for creating and using Kedro projects. For more
  information, type ``kedro info``.



  Kedro plugin for packaging a project with Docker

Options:
  -V, --version  Show version and exit
  -h, --help     Show this message and exit.

Global commands from Kedro
Commands:
  docs     See the kedro API docs and introductory tutorial.
  info     Get more information about kedro.
  new      Create a new kedro project.
  starter  Commands for working with project starters.

Project specific commands from Kedro
Commands:
  activate-nbstripout  Install the nbstripout git hook to automatically...
  build-docs           Build the project documentation.
  build-reqs           Run `pip-compile` on src/requirements.txt or the...
  catalog              Commands for working with catalog.
  ipython              Open IPython with project specific variables loaded.
  jupyter              Open Jupyter Notebook / Lab with project specific...
  lint                 Run flake8, isort and black.
  micropkg             Commands for working with micro-packages.
  package              Package the project as a Python egg and wheel.
  pipeline             Commands for working with pipelines.
  registry             Commands for working with registered pipelines.
  run                  Run the pipeline.
  test                 Run the test suite.

Project specific commands from Docker
Commands:
  docker  Dockerize your Kedro project.

Your Environment

Include as many relevant details about the environment in which you experienced the bug:

  • Kedro version used (pip show kedro or kedro -V): 0.18.2
  • Python version used (python -V): 3.8.13, 3.10.5
  • Operating system and version: M1 Mac
@deepyaman deepyaman added Issue: Bug Report 🐞 Bug that needs to be fixed Component: CLI Issue/PR that addresses the CLI for Kedro labels Aug 3, 2022
@noklam
Copy link
Contributor

noklam commented Aug 3, 2022

This definitely looks like a bug, let's put it in inbox.

@deepyaman
Copy link
Member Author

The easy solution IMO would be to not define docstrings under the CLI group for each of these plugins. I don't see why it's necessary.

Of course, this doesn't deal with third-party plugins (that probably followed Kedro plugin examples) and did the same, but this is also not so sinister that it matters.

@deepyaman
Copy link
Member Author

@noklam Maybe it's this:

help_texts = [
cli.help
for cli_collection in sources
for cli in cli_collection.sources
if cli.help
]
self._dedupe_commands(sources)
super().__init__(
sources=sources,
help="\n\n".join(help_texts),
context_settings=CONTEXT_SETTINGS,
)

I'll look into it later...

@noklam
Copy link
Contributor

noklam commented Aug 22, 2022

I think this is closed unintentionally, reopen it as it is still relevant.

@deepyaman
Copy link
Member Author

deepyaman commented Feb 17, 2023

Partially resolved in kedro-org/kedro-viz#1001 and kedro-org/kedro-plugins#56; pending in kedro-org/kedro-plugins#118

@merelcht
Copy link
Member

This can now be closed because all PRs addressing this have been merged 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: CLI Issue/PR that addresses the CLI for Kedro Issue: Bug Report 🐞 Bug that needs to be fixed
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants