Skip to content

Add uv support alongside pixi - #1

Open
matthiaskoenig wants to merge 1 commit into
dyscolab:mainfrom
matthiaskoenig:uv-support
Open

matthiaskoenig wants to merge 1 commit into
dyscolab:mainfrom
matthiaskoenig:uv-support

Conversation

@matthiaskoenig

Copy link
Copy Markdown

Adds a pyproject.toml so the tutorials can be run with uv as well as pixi. Nothing about the pixi workflow changes — pixi.toml, pixi.lock and pixi run open are untouched.

What's in here

uv environment. pyproject.toml mirrors the dependency set from pixi.toml, with the conda-side packages declared as their PyPI equivalents (python-libsbml, pylatex) and the same lower bounds. .python-version pins 3.13. uv.lock and .venv/ are gitignored.

uv run marimo edit tutorials                       # landing page
uv run marimo edit tutorials/poincare_intro.py     # one notebook

Both verified working locally.

A marimo check fix. poincare_intro.py, simbio_intro.py and analysis.py each reported:

error[branch-expression]: The if statement has branches ending with expressions
that won't be displayed... consider assigning to a dummy variable: `_ = ...`

The playground micropip bootstrap was the last statement in the setup cell, so marimo tried to render its result as the cell output. Applying marimo's own suggestion (_ = await micropip.install(...)) clears it. io.py wasn't affected — it has a def after the if — but got the same treatment so all four setup cells match. marimo check is now clean on all four notebooks.

Linter config. tutorials/ is excluded from ruff and ty in pyproject.toml. The notebooks are valid marimo but not valid plain Python — the top-level async with app.setup() that marimo generates makes ty report invalid-syntax, which isn't suppressible per-rule. marimo check is the right linter for these files.

README. Local setup split into ## pixi and ## uv sections.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JDjggCk5H5pJrUWb2b9ENV

Mirror the pixi dependency set in pyproject.toml so the tutorials can also
be run with uv, and document both workflows in the README.

- pyproject.toml: declare the conda and pypi dependencies from pixi.toml as
  PyPI requirements, pinned to the same lower bounds; add .python-version
- pyproject.toml: exclude tutorials/ from ruff and ty. marimo notebooks are
  not valid plain Python (top-level `async with app.setup()`), so they are
  linted with `marimo check` instead
- tutorials/: assign the micropip bootstrap to a dummy variable, fixing the
  `error[branch-expression]` reported by `marimo check` in poincare_intro,
  simbio_intro and analysis
- README.md: split the local setup into pixi and uv sections
- .gitignore: ignore .venv/ and uv.lock

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JDjggCk5H5pJrUWb2b9ENV
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