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

Add an option to show predefined tasks across environments easily #1276

Closed
hoxbro opened this issue Apr 25, 2024 · 7 comments · Fixed by #1286
Closed

Add an option to show predefined tasks across environments easily #1276

hoxbro opened this issue Apr 25, 2024 · 7 comments · Fixed by #1286
Labels
✨ enhancement Feature request 👋 good first issue Good for newcomers

Comments

@hoxbro
Copy link
Contributor

hoxbro commented Apr 25, 2024

Problem description

I want to show a predefined list of tasks across environments when running pixi task list (or a new command). This will make it easy for me to explain what tasks are available for new users.

Currently, pixi task list only shows the task available in the default environments (in my case it is install and download-data). A way to show all tasks is pixi run non-existing-task, which shows all tasks.

❯ pixi run non-existing-task
non-existing-task: command not found

Available tasks:
        build-conda
        build-pip
        build-pyodide
        docs-build
        docs-server
        download-data
        install
        lint
        lint-install
        test-example
        test-ui
        test-unit
        x-docs-convert-gallery
        x-docs-copy-panel-dist
        x-docs-generate
        x-docs-pyodide
        x-docs-refmanual
        x-install-ui

At the same time, there are some tasks I don't want to show. These are prefixed with x- to put at the bottom of the list.

@hoxbro hoxbro added the ✨ enhancement Feature request label Apr 25, 2024
@ruben-arts
Copy link
Contributor

I want this to!

@ruben-arts ruben-arts added the 👋 good first issue Good for newcomers label Apr 26, 2024
@hoxbro
Copy link
Contributor Author

hoxbro commented Apr 26, 2024

I want to give it a go. Some questions I have are

  1. How should I expose it? A field in pixi.toml. If so, what should it be called? project.available-tasks could be an option.
  2. Should I use the current command pixi task list and show the available tasks if that setting is enabled (and an environment has not been passed)? Or should I use a new command?

@ruben-arts
Copy link
Contributor

I would reuse the current pixi task list command. Note pixi task list --summary is used for auto-completion.

I don't think its weird that it would list all tasks in the project by default. The --environment already works so we should leave that in.

@abkfenris
Copy link
Contributor

I also ran into this yesterday.

I know it would be different than how --environment works for other commands, but what about making pixi task list show all by default, and --environment filters to just that specific environment?

@hoxbro
Copy link
Contributor Author

hoxbro commented Apr 26, 2024

The --environment already works so we should leave that in.

That was what I meant, sorry if I was not clear.

What about an option to hide certain tasks?

Maybe: generate-schema = { cmd = "python model.py > schema.json", cwd = "schema" , hide_task=true}

@ruben-arts
Copy link
Contributor

Ah I only focused on the cli.

Hiding the task would be a different story. Would you want to exclude it from the runnable tasks? Then we could do the same as Taskfile and name it internal = true then it will not be listed in the task list and also not be excepted as a runnable task. Otherwise hidden = true would make sense to me, if you would only want to hide it from the list.

@ruben-arts
Copy link
Contributor

But these could definitely be two PR's, that would make it easier to review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement Feature request 👋 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants