Skip to content

feat: run conda-script files via pixi run --experimental --script - #6909

Open
Hofer-Julian wants to merge 1 commit into
conda-script-shellfrom
conda-script-run
Open

feat: run conda-script files via pixi run --experimental --script#6909
Hofer-Julian wants to merge 1 commit into
conda-script-shellfrom
conda-script-run

Conversation

@Hofer-Julian

@Hofer-Julian Hofer-Julian commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

pixi run --script FILE runs conda-script files (#3751) end to end.

  • --experimental gates the new path and has no effect for PEP 723 scripts, so #!/usr/bin/env -S pixi run --experimental --script works for both block kinds
  • pixi config set experimental.conda-script true --global opts in without the flag and warns on every run instead, so the error points at that command
  • [dependencies] fills the default feature and [tool.pixi.*] becomes a second feature of the default environment
  • The environment resolves for the machine, an adjacent lock file wins when present, and pixi lock --script FILE writes FILE.pixi.lock for conda-script files too
  • The entrypoint runs through the mini-shell with ${SCRIPT} and ${CACHE} defined and the working directory left at the invocation directory
  • Signals pixi receives are forwarded to the entrypoint, and its processes are terminated when pixi stops, the same as for tasks

@Hofer-Julian Hofer-Julian changed the title conda script run feat: run conda-script files via pixi run --experimental --script Aug 27, 2026
@Hofer-Julian
Hofer-Julian force-pushed the conda-script-run branch 2 times, most recently from 38212f8 to 77ac750 Compare August 31, 2026 11:20
@Hofer-Julian
Hofer-Julian marked this pull request as ready for review August 31, 2026 12:43
@Hofer-Julian
Hofer-Julian force-pushed the conda-script-run branch 2 times, most recently from dd17be8 to b841299 Compare September 3, 2026 12:35
@Hofer-Julian
Hofer-Julian force-pushed the conda-script-run branch 2 times, most recently from 3ddfb85 to e3ffe5a Compare September 3, 2026 13:22
@ruben-arts

Copy link
Copy Markdown
Contributor

What is your plan for making this not experimental?

@ruben-arts

Copy link
Copy Markdown
Contributor

Do you think it would make sense to have default entrypoints?

@Hofer-Julian

Copy link
Copy Markdown
Contributor Author

What is your plan for making this not experimental?

As soon as the CEP is accepted or at least the syntax is unlikely to change, this will not be experimental anymore

@Hofer-Julian

Copy link
Copy Markdown
Contributor Author

Do you think it would make sense to have default entrypoints?

I think the sweet spot is to have defaults in pixi init

Wires the conda-script proposal (#3751) into the CLI. A `--script` file with a
`/// conda-script` block routes to a new path behind the `--experimental`
flag, which has no effect for PEP 723 scripts so a shebang line can pass it
unconditionally. The `experimental.conda-script` configuration option opts in
without the flag and warns on every run instead. The block synthesizes a
workspace through the existing script machinery: `[dependencies]` fills the
default feature while `[tool.pixi.dependencies]` and
`[tool.pixi.pypi-dependencies]` become a second feature of the default
environment, so both spec sets reach the solver as a union. The environment
resolves for the host, an adjacent lock file wins when present, and
`pixi lock --script FILE` writes `FILE.pixi.lock` for conda-script files too.
The entrypoint runs through the mini-shell with `${SCRIPT}` and `${CACHE}`
defined, cwd left at the invocation directory and CLI arguments appended to
the last command. Signals pixi receives are forwarded to the entrypoint, and
its processes are terminated when pixi stops, the same as for tasks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants