From fcc9fe289f3fd65993309a3a2348d65da859936d Mon Sep 17 00:00:00 2001 From: David Kane Date: Fri, 21 Aug 2026 20:33:05 -0400 Subject: [PATCH 1/2] Course-package refresh + quarto/python-chunk smoke test (v1.1.4 prep) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit COURSE_PKG_REFRESH → 2026-08-22 so the course layer rebuilds and bakes the 30 commits landed across the four PPBDS packages since v1.1.3 (misc.tutorials 14, vscode.tutorials 12, primer.tutorials 3, tutorial.helpers 1). New smoke test 3 in the Python section: quarto renders a .qmd Python chunk via the jupyter engine, as rstudio, from the CLI. This makes falsifiable the claim behind dropping the VS Code Python extensions in codespace-starter — that nothing students actually do depends on them. The chunk writes a file rather than asserting on rendered HTML, so a pass means the chunk really executed with pandas importable. NOT released; awaiting David's go. Co-Authored-By: Claude Fable 5 --- Dockerfile | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f1dc038..21f5c1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -459,7 +459,7 @@ RUN R -q -e 'pak::pkg_install(c("devtools", "pkgdown", "roxygen2", "testthat", " # cache hit (2026-07-27) and delivered bit-identical bits. Bump this date in # any release whose purpose is picking up new course-package commits from # GitHub HEAD; layers above stay cached, this one and everything after rebuild. -ARG COURSE_PKG_REFRESH=2026-08-14 +ARG COURSE_PKG_REFRESH=2026-08-22 RUN echo "course-package refresh: ${COURSE_PKG_REFRESH}" \ && R -q -e 'pak::pkg_install(c( \ "PPBDS/tutorial.helpers", \ @@ -578,6 +578,35 @@ RUN python -c "import numpy, pandas, matplotlib, seaborn, sklearn, statsmodels, RUN su rstudio -c "/opt/venv/bin/pip install --no-cache-dir --quiet cowsay" \ && /opt/venv/bin/python -c "import cowsay; print('rstudio-can-install OK')" \ && /opt/venv/bin/pip uninstall -y --quiet cowsay + +# Smoke test 3: Quarto renders a Python chunk through the jupyter engine, +# driven entirely from the CLI. This is the student-facing Python path now +# that codespace-starter dropped the VS Code Python extensions (2026-08-20, +# to thin the Activity Bar): the claim was that nothing students actually do +# depends on those extensions, and this test is that claim made falsifiable. +# The chunk writes a file rather than checking rendered HTML, so the test +# proves the chunk EXECUTED (with pandas importable) rather than merely that +# quarto emitted a document. Runs as rstudio, like a student. NOT covered, +# and deliberately gone with the extensions: the editor-side .ipynb UI, cell +# run-buttons, and Python IntelliSense. +RUN mkdir -p /tmp/pysmoke \ + && printf '%s\n' \ + '---' \ + 'title: py-engine smoke' \ + 'format: html' \ + '---' \ + '' \ + '```{python}' \ + 'import pandas as pd' \ + 'open("/tmp/pysmoke/chunk-ran", "w").write(str(int(pd.Series([1, 2, 3]).sum())))' \ + '```' \ + > /tmp/pysmoke/smoke.qmd \ + && chown -R rstudio /tmp/pysmoke \ + && su rstudio -c "cd /tmp/pysmoke && quarto render smoke.qmd --to html" \ + && test -f /tmp/pysmoke/smoke.html \ + && grep -qx '6' /tmp/pysmoke/chunk-ran \ + && echo "quarto python-chunk render OK" \ + && rm -rf /tmp/pysmoke # ───────────────────────────────────────────────────────────────────────────── # ── Observable Framework ───────────────────────────────────────────────────── From 807ac949fc888960ba9f0273ea6a42438fcd39ea Mon Sep 17 00:00:00 2001 From: David Kane Date: Fri, 21 Aug 2026 23:00:55 -0400 Subject: [PATCH 2/2] Fix the python smoke test: su resets PATH, hiding the venv from quarto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First run (build 32544605003) failed with "Jupyter is not available in this Python installation": `su rstudio -c` resets PATH on Debian, so /opt/venv/bin — which this image's ENV puts first — was dropped and quarto fell back to the system python3 with no jupyter/yaml. Pass PATH through explicitly and document the trap; the pip test above avoids it with an absolute path for the same reason. Test-harness bug only. Students inherit the container ENV in their terminals, so the capability under test was never actually broken. Everything upstream of this step passed, including the refreshed course packages and their Suggests contract. Co-Authored-By: Claude Fable 5 --- Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 21f5c1c..5f05dde 100644 --- a/Dockerfile +++ b/Dockerfile @@ -589,6 +589,15 @@ RUN su rstudio -c "/opt/venv/bin/pip install --no-cache-dir --quiet cowsay" \ # quarto emitted a document. Runs as rstudio, like a student. NOT covered, # and deliberately gone with the extensions: the editor-side .ipynb UI, cell # run-buttons, and Python IntelliSense. +# +# PATH is passed through explicitly because `su rstudio -c` RESETS it on +# Debian (login.defs), dropping the /opt/venv/bin that this image's ENV puts +# first — Quarto then falls back to the system python3, which has no jupyter +# or yaml, and the render dies with "Jupyter is not available in this Python +# installation" (build 32544605003). Students are unaffected: their terminals +# inherit the container ENV. Same reason the pip test above uses an absolute +# /opt/venv/bin path. The outer shell expands $PATH here, so the literal +# venv-first path is what reaches rstudio. RUN mkdir -p /tmp/pysmoke \ && printf '%s\n' \ '---' \ @@ -602,7 +611,7 @@ RUN mkdir -p /tmp/pysmoke \ '```' \ > /tmp/pysmoke/smoke.qmd \ && chown -R rstudio /tmp/pysmoke \ - && su rstudio -c "cd /tmp/pysmoke && quarto render smoke.qmd --to html" \ + && su rstudio -c "cd /tmp/pysmoke && PATH='$PATH' quarto render smoke.qmd --to html" \ && test -f /tmp/pysmoke/smoke.html \ && grep -qx '6' /tmp/pysmoke/chunk-ran \ && echo "quarto python-chunk render OK" \