Skip to content

Allow specifying a default environment for tasks #5140

@maxnoe

Description

@maxnoe

Problem description

Currently, I'm using the following pattern to run the doc task by default in the doc environment:

[tool.pixi.tasks]

# one low-level task with the command, one wrapper to use the correct environment
_doc = { cmd = ["make", "html"], cwd = "docs" }
doc = { depends-on = [{task = "_doc", environment = "doc"}] }

I think it would be great if tasks could have a default environment (other than the default environment) instead:

[tool.pixi.tasks]
doc = { cmd = ["make", "html"], cwd = "docs", default-environment = "doc" }

Which would mean that pixi run doc would use the doc environment by default, but would still allow overriding it with the -e option.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions