feat: run conda-script files via pixi run --experimental --script - #6909
Draft
Hofer-Julian wants to merge 1 commit into
Draft
feat: run conda-script files via pixi run --experimental --script#6909Hofer-Julian wants to merge 1 commit into
pixi run --experimental --script#6909Hofer-Julian wants to merge 1 commit into
Conversation
pixi run --experimental --script
Hofer-Julian
force-pushed
the
conda-script-run
branch
from
August 27, 2026 15:20
7ef2f56 to
e434b69
Compare
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 is inert for PEP 723 scripts so a shebang line can pass it unconditionally. 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.
Hofer-Julian
force-pushed
the
conda-script-run
branch
from
August 27, 2026 15:30
e434b69 to
38212f8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pixi run --experimental --script FILEruns conda-script files (#3751) end to end.--experimentalgates the new path and is inert for PEP 723 scripts, so#!/usr/bin/env -S pixi run --experimental --scriptworks for both block kinds; a conda-script file without the flag errors with a hint naming it[dependencies]fills the default feature and[tool.pixi.*]becomes a second feature of the default environment, so both spec sets reach the solver as a unionpixi lock --script FILEwritesFILE.pixi.lockfor conda-script files too${SCRIPT}and${CACHE}defined and the working directory left at the invocation directory.pyfile falls back to the PEP 723 path, so files that ran before keep running;pixi init --scriptrefuses files that already carry a conda-script block${CACHE}persistence,whendependencies and lockingConsiderations before merging
pixi lock --scriptaccepts conda-script files without--experimental, since the flag only exists onrun; locking a file with source dependencies fetches and builds them, like a PEP 723 script with the pixi-build preview doesrun,lockandinitknow about conda-script files;add,update,listand friends still report "not a Python script"--separator, the same as for PEP 723 scripts; a shebang line cannot insert one