Skip to content

Add pyproject.toml so the notebooks run with uv - #23

Merged
AllenDowney merged 1 commit into
AllenDowney:v3from
dgwartney:uv-support
Nov 10, 2026
Merged

AllenDowney merged 1 commit into
AllenDowney:v3from
dgwartney:uv-support

Conversation

@dgwartney

Copy link
Copy Markdown
Contributor

This adds a pyproject.toml so the book's notebooks can be run with uv (uv sync, then uv run jupyter lab). uv is increasingly popular for its speed, and this lets readers who use it get a working environment with one command. Nothing else changes; requirements.txt, requirements-dev.txt and environment.yml still work as before.

  • Dependencies are the packages in requirements.txt; the tools in requirements-dev.txt are a dev dependency group.
  • Python is 3.12, matching environment.yml.
  • Adds lifelines, which Chapter 13 imports. Its %pip install lifelines fallback fails under uv, because a uv environment has no pip.

Tested on macOS (Apple silicon) with uv 0.13.6: after uv sync, every chapter notebook in nb/ and soln/ (0–14) runs headless with jupyter nbconvert --execute, with no errors.

Lists the packages from requirements.txt as dependencies and
requirements-dev.txt as a dev group, with Python 3.12 as in
environment.yml. Adds lifelines, which chapter 13 imports: its
%pip install fallback fails in a uv environment, which has no pip.

Checked with uv sync: every chapter notebook in nb/ and soln/
(0-14) runs headless without errors.
@AllenDowney
AllenDowney merged commit 17d9bcc into AllenDowney:v3 Nov 10, 2026
AllenDowney added a commit that referenced this pull request Nov 10, 2026
…up (follow-up to PR #23).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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