Skip to content

v2.0: migrate template from environment.yml/micromamba to pixi#1

Merged
annefou merged 3 commits into
mainfrom
pixi-migration
May 21, 2026
Merged

v2.0: migrate template from environment.yml/micromamba to pixi#1
annefou merged 3 commits into
mainfrom
pixi-migration

Conversation

@annefou
Copy link
Copy Markdown
Contributor

@annefou annefou commented May 21, 2026

Summary

  • Replaces environment.yml + mamba-org/setup-micromamba@v3 with pixi.toml + pixi.lock + prefix-dev/setup-pixi@v0.9. Lockfile is committed and pins linux-64 + osx-arm64 + win-64. Channels: conda-forge + bioconda (snakemake is not on conda-forge).
  • 27 files changed; safe-rollback tag v1.0-environment-yml already pushed for existing forks that need the old flow.
  • Dockerfile rebased on ghcr.io/prefix-dev/pixi:0.68.1; jupyter-book.yml drops setup-node + npm install -g mystmd (mystmd now ships from conda-forge via feature.docs).
  • See docs/cicd-conventions.md for the rewritten conventions doc and the new audit step (pixi install --locked && git diff --exit-code pixi.lock).

Deviations from the original migration plan

  • channels = ["conda-forge", "bioconda"], not ["conda-forge"] alone — the plan assumed snakemake was on conda-forge; it is bioconda-only. Pixi handles the multi-channel solve cleanly.
  • setup-pixi@v0.9 (actual current major; plan said v0.8.x).
  • All three workflow guards (ci.yml, jupyter-book.yml, docker.yml) now also scan *.toml so pixi.toml's {{REPO_NAME}} placeholder triggers the scaffold-skip path.
  • .snakemake/ added to .gitignore alongside .pixi/.

Test plan

  • pixi install --locked clean on osx-arm64 (all 3 envs: default, docs, tests).
  • pixi run snakemake --cores 1 -n produces the scaffold DAG.
  • pixi run -e docs myst build --html writes _build/html/.
  • First-run guard catches {{REPO_NAME}} in pixi.toml.
  • CI green on this branch (ci.yml, jupyter-book.yml).
  • Trial-init repo: clone template, run /init-template, verify {{REPO_NAME}} substitutes in pixi.toml, CI stays green end-to-end.

After merge

  • Cut v2.0.0 release with body: "Default dep manifest is now pixi.toml + pixi.lock. For the previous environment.yml/micromamba flow, pin to tag v1.0-environment-yml."

annefou added 3 commits May 21, 2026 17:20
Switch the template's dep-manifest from environment.yml/micromamba to
pixi.toml + pixi.lock. Lockfile is committed, pins linux-64 + osx-arm64 +
win-64. Channels: conda-forge + bioconda (snakemake is not on conda-forge).

Mechanics
- pixi.toml: workspace name {{REPO_NAME}}, dependencies mirror env.yml core,
  feature.docs (mystmd) and feature.tests (pytest) split out, tasks for run /
  book / lab. pixi accepts the {{REPO_NAME}} placeholder; /init-template
  substitutes it.
- pixi.lock: 12k-line per-platform lockfile, 3 envs (default + docs + tests).
- environment.yml deleted; v1.0-environment-yml tag (pushed) preserves the
  old flow for existing forks.

Build / CI
- Dockerfile: mambaorg/micromamba -> ghcr.io/prefix-dev/pixi:0.68.1, install
  from pixi.lock, drop the micromamba entrypoint, CMD via pixi run.
- ci.yml + jupyter-book.yml: setup-micromamba -> prefix-dev/setup-pixi@v0.9
  with locked + cache; all run steps become pixi run. jupyter-book.yml uses
  the docs feature; setup-node + npm install -g mystmd is removed (mystmd
  ships from conda-forge now).
- docker.yml: unchanged except its first-run guard now includes *.toml.
- All three workflow guards now scan *.toml so pixi.toml's {{REPO_NAME}}
  placeholder is detected during scaffold runs.

Docs
- docs/cicd-conventions.md: major rewrite — "environment.yml is the single
  source of truth" -> "pixi.toml is the single source of truth"; old
  snakemake-via-pip workaround section dropped; all examples use pixi run.
  Audit step adds a pixi.lock-staleness check.
- docs/fair4rs-checklist.md, ro-crate.md, verify-before-drafting.md,
  nanopub-chain-discovery.md, domain-flavours/{_template, biodiversity-eo}.md:
  references to environment.yml swapped to pixi.toml + pixi.lock.
- grid4earth-benchmark.md flavour deferred (separate release).

Operating manual
- CLAUDE.md, DOMAIN.md: I (Interoperable) evidence and Phase 2 + document map
  point to pixi.toml + pixi.lock.
- .claude/settings.json: Bash(pixi *) added to allowlist.
- .claude/agents/replication-coder.md + .claude/skills/{replication-study,
  init-template, import-from-nanopub}/SKILL.md: env.yml -> pixi.toml; starter
  files for /import-from-nanopub now include pixi.toml + pixi.lock.

Repo metadata
- README.md, index.md, notebooks/README.md: quick-start uses pixi install +
  pixi run snakemake; structure block names pixi.toml + pixi.lock.
- ro-crate-metadata.json: replaces environment.yml ConfigurationFile entry
  with pixi.toml + pixi.lock (both ConfigurationFile; both Workflow inputs).
- scripts/import-nanopub-chain.py: STARTER_FILES enumeration now ships
  pixi.toml + pixi.lock; user-facing merge instructions rewritten.
- .gitignore: ignore .pixi/ install cache and .snakemake/ run cache;
  pixi.lock is NOT ignored.

Acceptance (osx-arm64)
- pixi install --locked: green; lockfile stable.
- pixi run snakemake --cores 1 -n: dry-run produces the scaffold DAG.
- pixi run -e docs myst build --html: builds the Jupyter Book to _build/html.
setup-pixi only publishes patch-level tags. CI failed at action resolution
on first push. Pin to the current latest, v0.9.6.
The pre-existing v1 guards used `if ... | head -1 > /dev/null` which
always returns 0 under bash without pipefail (the GH Actions default
when shell is unspecified) — so the guard fired even when no placeholders
remained. Rewrite each guard to capture the grep output into a variable
and check it with `[ -n "$..." ]`.

Also relax the init-template skill exclusion from `^./...` to a
path-fragment match (`claude/skills/init-template/`) — strict `^./`
anchor only matches when grep emits `./` prefix, which differs between
greps.

Also fix the pages_check guard in jupyter-book.yml the same way:
`gh api ... | head -1 > /dev/null` always succeeds and flagged Pages
as enabled on repos where it isn't, causing the deploy step to 404.

Validated end-to-end on a trial substituted-state repo:
- ci.yml ran setup-pixi + pixi install + pixi run snakemake green (41s).
- jupyter-book.yml build step ran setup-pixi (docs env) + pixi run
  jupytext + pixi run jupyter execute + pixi run -e docs myst build
  green (1m01s).
@annefou annefou merged commit 9dec735 into main May 21, 2026
1 check passed
@annefou annefou deleted the pixi-migration branch May 21, 2026 16:00
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.

1 participant