Skip to content

_base/environment-update.yml: one pinned, up-to-date environment for the sites, kept whole by pool-check - #70

Merged
mmcky merged 2 commits into
mainfrom
base-environment
Nov 18, 2026
Merged

mmcky merged 2 commits into
mainfrom
base-environment

Conversation

@mmcky

@mmcky mmcky commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

What

The first item of the one-environment work (QuantEcon/project-monorepo#77; design note, "The work", item 1). _base/environment-update.yml is what a build will apply over the full image ghcr.io/quantecon/quantecon through quantecon/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, and dp after its first shadow comparison.

The baseline (the owner's decisions of 2026-11-18 and 2026-11-19)

  • Every version is exact, for stability while the sites' builds are first developed. A person changes a pin after testing; a workflow that watches for new releases is to be tracked on QuantEcon/project-monorepo#7.
  • One up-to-date baseline: the newest release of every package on 2026-11-19, which the six series are then brought to upstream, one pull request per series (environment.yml raised, the lectures' --upgrade/-U install lines removed), intro first.
  • jax is in the list at 0.11.0 (the CPU wheel); a GPU build adds jax[cuda13]==0.11.0 on top.
Group Pin Packages
Build stack newest release (jupyter-book: newest 1.x) jupyter-book 1.0.4.post1, quantecon-book-theme 0.22.2, sphinx-tojupyter 0.6.0, sphinxext-rediraffe 0.3.0, sphinx-exercise 1.2.2, sphinx-proof 0.4.1, sphinxcontrib-youtube 1.5.0, sphinx-togglebutton 0.4.5, sphinx-reredirects 1.1.0
What a series' build adds newest; jax by decision kaleido 1.5.1, numpyro 0.22.0, jax 0.11.0 (the newest is 0.12.1; 0.11.1 hangs one of programming's lectures)
Anaconda 2026.07's own its version, the base every series builds on pandas 3.0.3, plotly 6.7.0, rich 15.0.0, seaborn 0.13.2, statsmodels 0.14.6, tabulate 0.10.0
The rest the lectures install newest; a lecture's own limit where it has one arviz 1.3.0, cvxopt 1.3.3, cvxpy 1.9.3, highspy 1.16.0, interpolation 2.2.7, keras 3.15.1, linearmodels 7.1, myst-nb 1.4.0, optax 0.2.9, pandas-datareader 0.11.1, polars 2.1.0, polytope 0.2.5, POT 0.9.7.post1, prettytable 3.17.0 (house_auction asks for <3.18), pymc 6.4.0, quantecon 0.13.1, quantecon-book-networks 1.6 (two lectures ask for ==1.6), wbgapi 1.0.14, xlrd 2.0.2, yfinance 1.8.0; plotly-orca 1.3.1 (conda, plotly channel)

Evidence

  • Cross-checked against the six series' environment.yml files (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.
  • It resolves (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).
  • Over the full image it moves kaleido from 0.2.1 to 1.5.1, which needs a Chrome the image does not hold yet (Pin kaleido<1.0 in both containers to fix ChromeNotFoundError actions#85). An issue for the image (a system Chrome at a standard path) comes before the CPU leg is built.
  • conda env update installs the pip list with pip install -U -r, so an entry without a version would take the newest release on every build; the environment rule 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-execution ones included; nothing inside another directive, whether backtick, tilde or colon fenced) and as a shell splits commands (!, !!, %pip, %conda, %mamba, %%bash/%%sh cells; 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.
  • On today's pool, 161 lectures install 30 packages, all listed (39 entries). MyST-NB 1.4.0's own reader, run over all 328 lectures, finds the same install lines.
  • A refresh that brings in a new install fails the refresh pull request's pool-check. The pin goes in a pull request of its own to main, since drift-check rebuilds drift/refresh from main on every run (_base/README.md).

What follows (not in this PR)

  • A lecture's --upgrade/-U line, or a !conda install of 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-orca lines, after which plotly-orca leaves the list.
  • The GPU machine image holds no anaconda metapackage, so the GPU leg must provide that base as well; it is settled with the GPU leg.

Checks

  • The tools' tests: 308 passed, 1 skipped (23 new; each of 15 single-line mutations of the new code fails at least one).
  • Three adversarial reviews (parsing, pins, the CI path and the claims); their findings are addressed here or listed above as follow-ups.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL

…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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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-listed and environment rules 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.

Comment thread tools/pool-check Outdated
Comment on lines +76 to +77
version limit (``"prettytable<3.18"``) allows the listed version. Read
are the notebook cells MyST-NB makes (top-level ``{code-cell}`` blocks;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

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