Skip to content

Fix site build: Altair PNG rendering, missing CSS, and CI cleanup - #23

Merged
tdhopper merged 9 commits into
masterfrom
fix-build
Aug 5, 2026
Merged

Fix site build: Altair PNG rendering, missing CSS, and CI cleanup#23
tdhopper merged 9 commits into
masterfrom
fix-build

Conversation

@tdhopper

@tdhopper tdhopper commented Aug 4, 2026

Copy link
Copy Markdown
Owner

TL;DR

The site has not built since 2020: the November 2025 modernization left Altair's PNG renderer disabled (12 of 66 example cells produced no images, and render.py aborts on the first missing one), and the CSS the template links was deleted from the repo in 2018, so a successful build still looked wrong. With both fixed, the full notebook executes cleanly and the rendered site matches the old aesthetic. Verified locally end to end: all 66 plots render, tests pass.

Files to review (24, +3,249 / -900, mostly uv.lock and deletions):

File Why
Examples.ipynb (start here) Setup cell restores alt.renderers.enable("png"); one seaborn cell moves off the removed shade= argument.
.github/workflows/deploy.yml Drops Firefox/geckodriver/xvfb/selenium (vestiges of pre-vl-convert Altair), adds uv caching and RSPM binary R packages.
web/css/custom.css, web/css/pygments-native.css Restored from commit 41aca4c^, which deleted them while the template kept linking them. S3 served stale copies for years.
tests/test_plots.py Reads tags from the notebook JSON instead of extracting images, so tests pass on the outputs-stripped notebook.
uv.lock Now committed (was gitignored) so CI builds stop drifting.

Reviewer notes

  • The checked-in notebook has no outputs. CI must execute it before rendering; the workflow now does nbconvert then render.py directly instead of make travis.
  • rpy2 falls back to ABI mode against Homebrew R locally. Works fine; CI uses r-lib's setup-r.
  • Deleted: .travis*, environment.yml, requirements.txt, runtime.txt, netlify_deploy.sh, and the three stale migration docs from November. Dependency truth is pyproject.toml + uv.lock.
  • Deploys now go to Cloudflare Pages, not Netlify. The workflow uploads web/ to the Cloudflare Pages project pythonplot: master pushes deploy with --branch=main (that project's production branch, serving pythonplot.com), everything else gets a preview URL. CLOUDFLARE_ACCOUNT_ID is already set as a repo secret. Tim still needs to add CLOUDFLARE_API_TOKEN (Cloudflare dashboard, API token with the Cloudflare Pages: Edit permission) before the deploy step can pass; the build steps run regardless. The upload path itself is verified: a local wrangler run of the same command produced https://fix-build.pythonplot.pages.dev, which serves the rendered site.

Restore alt.renderers.enable('png') that was dropped during the 2025
modernization attempt, and replace removed kdeplot shade= with fill=.
…ions

custom.css and pygments-native.css were deleted from the repo in 2018
but still referenced by the template; the live site was serving stale
copies from S3, which made the styling impossible to reproduce from
source.
CI is GitHub Actions with uv; dependency spec lives in pyproject.toml
and uv.lock. The Makefile s3/cloudfront targets' scripts are gone too
since deployment is Netlify.
@tdhopper
tdhopper marked this pull request as ready for review August 5, 2026 01:09
@tdhopper
tdhopper merged commit b67bc5c into master Aug 5, 2026
2 checks passed
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.

1 participant