[PR #1421] [CLOSED] fix(ci): prepend mlsysim/ to container PYTHONPATH so Quarto can find the package #9092

Closed
opened 2026-05-03 01:19:53 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1421
Author: @profvjreddi
Created: 4/20/2026
Status: Closed

Base: devHead: fix/quarto-build-pythonpath-mlsysim


📝 Commits (1)

  • 956c474 fix(ci): prepend mlsysim/ to container PYTHONPATH so Quarto can find the package

📊 Changes

1 file changed (+6 additions, -6 deletions)

View changed files

📝 .github/workflows/book-build-container.yml (+6 -6)

📄 Description

Summary

Final fix in the chain of three (#1419#1420 → this). The book build workflow sets
`PYTHONPATH` at the runner-step level for Linux and via `docker run -e PYTHONPATH` for
Windows, both pointing at the repo root. That override wins over the Quarto config change
in #1420 and runs into the exact same packaging issue exposed by #1397: the actual
`mlsysim` package lives at `<repo_root>/mlsysim/mlsysim/`, not at `<repo_root>/mlsysim/`.

Without this fix, `book-validate-dev` stays red on every Container Build Matrix job
(6 Linux + 6 Windows = 12 jobs) with `ModuleNotFoundError: No module named 'mlsysim.core'`.

Fix

Prepend `<repo_root>/mlsysim/` to `PYTHONPATH` in all 6 places it's set in
`book-build-container.yml`:

Line Context Platform
444 Preflight toolchain Linux
573 Preflight toolchain Windows (docker run -e)
591 Build (HTML/PDF/EPUB) Linux
649 Build (HTML/PDF/EPUB) Windows (docker run -e)
725 Compress PDF Windows (docker run -e)
808 Compress EPUB Windows (docker run -e)

Path separators per OS: `:` on Linux, `;` on Windows. The original repo-root entry is
preserved.

Why three PRs instead of one

Same root cause, three surfaces. I cut them small so each one's blast radius is obvious
in review and the bisect history stays useful:

  • #1419 — `book/tests/test_units.py` (one test file)
  • #1420 — Quarto exec env (5 config files; protects local builds)
  • This PR — workflow env (1 workflow file; protects CI builds, which override the config env)

Together they restore `book-validate-dev` to green for the first time since 2026-04-17.

Verification

  • YAML parses cleanly.
  • Linux pattern verified locally with the equivalent environment in PR #1420's verification step.
  • Windows pattern can only be validated in CI; the patch is a mechanical translation of the
    Linux fix using `;` separator and backslash paths to match the existing template.

What this unblocks

`book-validate-dev` green → `infra-publish-guard.yml` re-armed → `book-publish-live`
becomes triggerable for vol1 v0.6.0 / vol2 v0.1.0.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1421 **Author:** [@profvjreddi](https://github.com/profvjreddi) **Created:** 4/20/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/quarto-build-pythonpath-mlsysim` --- ### 📝 Commits (1) - [`956c474`](https://github.com/harvard-edge/cs249r_book/commit/956c474411ef2e70e5c461847bd2123dc9ab9e1d) fix(ci): prepend mlsysim/ to container PYTHONPATH so Quarto can find the package ### 📊 Changes **1 file changed** (+6 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/book-build-container.yml` (+6 -6) </details> ### 📄 Description ## Summary Final fix in the chain of three (#1419 → #1420 → this). The book build workflow sets \`PYTHONPATH\` at the runner-step level for Linux and via \`docker run -e PYTHONPATH\` for Windows, both pointing at the repo root. That override wins over the Quarto config change in #1420 and runs into the exact same packaging issue exposed by #1397: the actual \`mlsysim\` package lives at \`<repo_root>/mlsysim/mlsysim/\`, not at \`<repo_root>/mlsysim/\`. Without this fix, \`book-validate-dev\` stays red on every Container Build Matrix job (6 Linux + 6 Windows = 12 jobs) with \`ModuleNotFoundError: No module named 'mlsysim.core'\`. ## Fix Prepend \`<repo_root>/mlsysim/\` to \`PYTHONPATH\` in all 6 places it's set in \`book-build-container.yml\`: | Line | Context | Platform | |---|---|---| | 444 | Preflight toolchain | Linux | | 573 | Preflight toolchain | Windows (docker run -e) | | 591 | Build (HTML/PDF/EPUB) | Linux | | 649 | Build (HTML/PDF/EPUB) | Windows (docker run -e) | | 725 | Compress PDF | Windows (docker run -e) | | 808 | Compress EPUB | Windows (docker run -e) | Path separators per OS: \`:\` on Linux, \`;\` on Windows. The original repo-root entry is preserved. ## Why three PRs instead of one Same root cause, three surfaces. I cut them small so each one's blast radius is obvious in review and the bisect history stays useful: - **#1419** — \`book/tests/test_units.py\` (one test file) - **#1420** — Quarto exec env (5 config files; protects local builds) - **This PR** — workflow env (1 workflow file; protects CI builds, which override the config env) Together they restore \`book-validate-dev\` to green for the first time since 2026-04-17. ## Verification - YAML parses cleanly. - Linux pattern verified locally with the equivalent environment in PR #1420's verification step. - Windows pattern can only be validated in CI; the patch is a mechanical translation of the Linux fix using \`;\` separator and backslash paths to match the existing template. ## What this unblocks \`book-validate-dev\` green → \`infra-publish-guard.yml\` re-armed → \`book-publish-live\` becomes triggerable for vol1 v0.6.0 / vol2 v0.1.0. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-03 01:19:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#9092