Add CondaWorkspace spec for conda.toml#91
Merged
Conversation
This was referenced Apr 29, 2026
2b24f4b to
324828a
Compare
CondaWorkspaces spec for conda.toml
Adds a new ProjectSpec for conda-workspaces, a conda subcommand plugin (`conda workspace`, `conda task`) whose on-disk format is a conda-native sibling of pixi.toml. Matches `conda.toml` with `[workspace]` and `pyproject.toml` with `[tool.conda.workspace]`. Re-uses two helpers from pixi.py rather than copying: * `extract_feature` becomes `extract_tasks`, parameterised by run-cmd and env-flag. Default args keep `Pixi.parse()` behaviour identical; `extract_feature` is kept as a compat shim. * `envs_from_lock` accepts both `version: 1` (conda.lock) and `version: 6` (pixi.lock); the rest of the rattler-lock schema is identical (see conda-workspaces' lockfile.py). A `pyproject.toml` with only `[tool.pixi.workspace]` stays with the existing Pixi spec; multiple specs already coexist on one project, so the conda-workspaces internal `tool.conda > tool.pixi` precedence is not encoded here. Tests cover positive/negative match (conda.toml, pyproject.toml, tasks-only, pixi-only), parse (envs, tasks, lockfile), the create roundtrip, registry membership, and a regression that Pixi's task cmd is unchanged after the refactor. Spec_doc points at https://conda-incubator.github.io/conda-workspaces/reference/conda-toml-spec/
324828a to
a0765a0
Compare
CondaWorkspaces spec for conda.tomlCondaWorkspace spec for conda.toml
Member
martindurant
left a comment
There was a problem hiding this comment.
Please add to the docs api.rst file too.
Author
|
Sorry I did not circle back in time for this, thanks for merging! |
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.
Adds a
CondaWorkspaces(ProjectSpec)for conda-workspaces, a conda subcommand plugin (conda workspace,conda task) whose on-disk format is a conda-native sibling ofpixi.tomland whose lockfile (conda.lock) is rattler-lock v6 with aversion: 1byte.Match
True iff a
[workspace]table is reachable through eitherconda.tomlorpyproject.toml[tool.conda.workspace]. Apyproject.tomlwith only[tool.pixi.workspace]stays with the existingPixispec — projspec's design lets multiple specs coexist on one project, and the conda-workspaces internaltool.conda > tool.pixiprecedence isn't projspec's concern. A bareconda.tomlwithout[workspace](a tasks-only manifest) does not match per the spec.Parse
Environmentcontent per env (stack=CONDA;precision=SPECfrom manifest,LOCKfromconda.lock).Commandper task.Processper task →conda task run <name> [-e <env>].CondaEnvper env →conda workspace install -e <env>(prefix path honours[workspace].envs-dir, default.conda/envs/<env>).LockFile→conda workspace lock.Re-use, not copy
Two helpers in
pixi.pyare shared rather than duplicated:extract_featureis generalised toextract_tasks(meta, procs, commands, proj, *, env, run_cmd, env_flag). Default args keepPixi.parse()byte-identical;extract_featureis kept as a compat shim.envs_from_lockaccepts bothversion: 1(conda.lock) andversion: 6(pixi.lock) — same rattler-lock schema.spec_docpoints at theconda.tomlspecification.Tests
13 new tests in
tests/test_conda_workspaces.pyplus aconda_workspacesentry intests/test_roundtrips.py::test_compliant. Includes a regression test thatPixi's task command is unchanged after the refactor. Local run: 58 pass in the relevant subset; full suite has 5 pre-existing failures unrelated to this PR (missing optional depsflask/django/JLab/RustPython/briefcasein my env).Tracking
Tracked in conda-incubator/conda-workspaces#30.