Repository navigation
_base/environment-update.yml: one pinned, up-to-date environment for the sites, kept whole by pool-check - #70
Conversation
…the sites, kept whole by pool-check The environment the sites are to build in (QuantEcon/project-monorepo#77; the design is ideas/one-environment-for-every-site.md in QuantEcon/project-monorepo, "The work", item 1): what a build applies over the full image, ghcr.io/quantecon/quantecon, through QuantEcon/actions' setup-environment. Nothing builds with it yet; the site-build workflow moves to it next. Every version is exact and is the newest release on 2026-11-19 (the owner's decisions of 2026-11-18 and -19: one up-to-date baseline, which the series are brought to upstream), except Anaconda 2026.07's own packages at its versions, jax at 0.11.0, jupyter-book on 1.x, and the newest prettytable a lecture's limit allows. tools/pool-check gains two rules. install-listed: every package a pool lecture's code cells install is listed, at a version the lecture's own limit allows; installs are read as MyST-NB makes cells and as a shell splits commands (!, %pip, %conda, %%bash cells; pip, python -m pip, uv pip, conda, mamba), and one it cannot read is reported. environment: every entry pinned to one version (==, also for conda), once. A refresh that brings in a new install fails the pool-check until a person pins it on main (_base/README.md). 23 new tests; packaging joins the check's dependencies. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
There was a problem hiding this comment.
🟡 Changes recommended
The change still has an unresolved review finding: a nit-level issue in tools/pool-check line 76 where an ungrammatical docstring (“Read are …”) makes the rule description hard to understand.
1 open issue
What changed in this PR
Introduces a single, fully pinned shared environment overlay (_base/environment-update.yml) and extends tools/pool-check to enforce that pool lectures’ installs are covered by (and strictly pinned within) that environment, supporting the “one environment for every site” effort.
Changes:
- Add a new pinned baseline environment overlay for consistent package versions across site builds.
- Extend pool-check with
install-listedandenvironmentrules to validate lecture installs and strict pinning/uniqueness. - Add tests plus CI/workflow and documentation updates to cover and describe the new contract.
| File | Description |
|---|---|
| tools/tests/test_pool_check_environment.py | Adds pytest coverage for the new environment pin-validation and lecture install-line parsing/reporting behavior. |
| tools/pool-check | Implements environment parsing and the install-listed/environment rules to enforce completeness and strict pinning of the shared environment. |
| README.md | Updates top-level documentation to describe the shared pinned environment approach and its enforcement via pool-check. |
| .github/workflows/tests.yml | Adjusts the test workflow to include required dependencies for running the updated tool/test suite. |
| .github/workflows/pool-check.yml | Updates the pool-check workflow triggers and documentation to include changes to the new environment overlay file. |
| _base/README.md | Adds guidance on the purpose and maintenance of the shared pinned environment overlay and related workflows. |
| _base/environment-update.yml | Introduces a fully pinned Conda environment overlay intended to be applied on top of the base image for consistent builds. |
Review effort: Balanced
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
| version limit (``"prettytable<3.18"``) allows the listed version. Read | ||
| are the notebook cells MyST-NB makes (top-level ``{code-cell}`` blocks; |
There was a problem hiding this comment.
Agreed; reworded in 0933613: "The check reads the notebook cells MyST-NB makes …, then their shell lines …, and in each line every command … that runs pip … install."
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL

What
The first item of the one-environment work (QuantEcon/project-monorepo#77; design note, "The work", item 1).
_base/environment-update.ymlis what a build will apply over the full imageghcr.io/quantecon/quanteconthroughquantecon/actions/setup-environment, so that a pool lecture executes with the same packages in every site that lists it. Two new pool-check rules keep it whole. Nothing builds with it yet: the site-build workflow's CPU leg moves to it in the next pull request, anddpafter its first shadow comparison.The baseline (the owner's decisions of 2026-11-18 and 2026-11-19)
environment.ymlraised, the lectures'--upgrade/-Uinstall lines removed), intro first.jax[cuda13]==0.11.0on top.Evidence
environment.ymlfiles (each the same on main and at its pin) and the package lists of their latest publish runs. Every series builds on Anaconda 2026.07's set above. The build stack here is at or above every series' (they name theme 0.22.0 or 0.22.1) and matches the full image's own. numpyro 0.22.0 and kaleido 1.x are what their builds install; intermediate and jax install the newest jax at build time (0.12.0.1 on 2026-11-11/12), programming 0.11.0.uv pip compile, linux x86_64, Python 3.13, with Anaconda 2026.07's 494 versions held as constraints) and moves four of Anaconda's packages: sphinx 9.1.0 to 7.4.7, markdown-it-py 4.0.0 to 3.0.0 and alabaster 1.0.0 to 0.7.16 (jupyter-book 1.x's requirements, as in every series' build today), and cffi 2.1.0 to 2.1.1 (yfinance's curl_cffi).conda env updateinstalls the pip list withpip install -U -r, so an entry without a version would take the newest release on every build; theenvironmentrule refuses one.The rules (tools/pool-check)
install-listed: every package a pool lecture's code cells install is listed, by name (PEP 503, across the pip and conda lists), at a version the lecture's own limit allows. Installs are read as MyST-NB makes notebook cells (top-level{code-cell}blocks,skip-executionones included; nothing inside another directive, whether backtick, tilde or colon fenced) and as a shell splits commands (!,!!,%pip,%conda,%mamba,%%bash/%%shcells;pip,pip3,python -m pip,{sys.executable} -m pip,uv pip,conda,mamba,micromamba; separators, redirections and option values). An install it cannot read (a requirements file, an editable, an address, an open quote) is reported, not skipped.environment: the file is a Conda environment file whose every entry is pinned to one version (==, for conda too, where a single=is a prefix), each once.drift/refreshfrom main on every run (_base/README.md).What follows (not in this PR)
--upgrade/-Uline, or a!conda installof a pinned package, replaces the pin for the rest of a build, since every lecture of a site shares the environment. They are removed upstream: intro 5, programming 5, intermediate 9, advanced 43, dp 20 and jax 5 lines, and the three!conda install … plotly-orcalines, after which plotly-orca leaves the list.anacondametapackage, so the GPU leg must provide that base as well; it is settled with the GPU leg.Checks
🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL