Skip to content

feat(tasks): allow outputs from pure depends-on tasks #5456

@RaphaelRibes

Description

@RaphaelRibes

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

Commands I ran and their output:

[ribesr@io-login-01 fastqc_vs_falco]$ pixi run get_all_deciles
Error:   × Unexpected keys, expected only 'cmd', 'depends-on', 'description', 'args'
    ╭─[/scratch/users/ribesr/fastqc_vs_falco/pixi.toml:25:1]
 24 │ [tasks.get_all_deciles]
 25 │ outputs = ["outputs/deciles1.tsv", "outputs/deciles2.tsv", "outputs/deciles3.tsv"]
    · ───┬───
    ·    ╰── 'outputs' was not expected here
 26 │ depends-on = [
    ╰────

pixi.toml/pyproject.toml file that reproduces my issue:

[tasks._mkdir_outputs]
cmd = "mkdir -p outputs"
outputs = ["outputs"]

[tasks.get_deciles]
args = ["folder"]
depends-on = [ "_mkdir_outputs" ]
cmd = "python scripts/getdeciles.py -f {{ folder }}"

[tasks.get_all_deciles]
depends-on = [
    { task = "get_deciles", args = ["1"] },
    { task = "get_deciles", args = ["2"] },
    { task = "get_deciles", args = ["3"] },
]
outputs = ["outputs/deciles1.tsv", "outputs/deciles2.tsv", "outputs/deciles3.tsv"]

pixi info output:

[ribesr@io-login-01 fastqc_vs_falco]$ pixi info
System
------------
       Pixi version: 0.63.2
        TLS backend: rustls
           Platform: linux-64
   Virtual packages: __unix=0=0
                   : __linux=5.14.0=0
                   : __glibc=2.34=0
                   : __archspec=1=zen4
          Cache dir: /home/ribesr/.cache/rattler/cache
       Auth storage: /home/ribesr/.rattler/credentials.json
   Config locations: No config files found

Global
------------
            Bin dir: /home/ribesr/.pixi/bin
    Environment dir: /home/ribesr/.pixi/envs
       Manifest dir: /home/ribesr/.pixi/manifests/pixi-global.toml

Other files (e.g. script files, source files, etc.):
You can replace cmd = "python scripts/getdeciles.py -f {{ folder }}" in get_deciles by cmd = "echo "Hello world !" > {{ folder }}" to test it more easily.

Issue description

I first thought it was because I didn't have the field inputs but _mkdir_outputs works without it...

Expected behavior

It is supposed to just run, you can put the outputs field in a task but here it tells me that I can only put cmd, depends-on, description, args

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