kedro-org / kedro

Kedro is a toolbox for production-ready data science. It uses software engineering best practices to help you create data engineering and data science pipelines that are reproducible, maintainable, and modular.
https://kedro.org
Apache License 2.0
9.91k stars 900 forks source link

Kedro CLI displays description for all installed plugins #1749

Closed deepyaman closed 1 year ago

deepyaman commented 2 years ago

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:

noklam commented 2 years ago

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

deepyaman commented 2 years ago

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 commented 2 years ago

@noklam Maybe it's this: https://github.com/kedro-org/kedro/blob/59064403e2590c992dceb51942f7dd9f6c97898a/kedro/framework/cli/utils.py#L119-L130

I'll look into it later...

noklam commented 2 years ago

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

deepyaman commented 1 year ago

Partially resolved in https://github.com/kedro-org/kedro-viz/pull/1001 and https://github.com/kedro-org/kedro-plugins/pull/56; pending in https://github.com/kedro-org/kedro-plugins/pull/118

merelcht commented 1 year ago

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