Skip to content

docs: the chart images load by absolute URL so PyPI renders them - #475

Merged
rejojer merged 1 commit into
mainfrom
docs/pypi-readme-absolute-images
Sep 4, 2026
Merged

rejojer merged 1 commit into
mainfrom
docs/pypi-readme-absolute-images

Conversation

@rejojer

@rejojer rejojer commented Sep 4, 2026

Copy link
Copy Markdown
Member

pyproject.toml publishes README.md as the PyPI description, and PyPI does not resolve a relative path against the GitHub repo. The five charts reference assets/*.png relatively, so they render as broken images on the project page — verified against the live 0.2.14 description, which carries all ten relative references.

Every chart now loads from raw.githubusercontent.com. The ten other images in the file were already absolute, so this makes the last five consistent rather than adding an exception.

Two things worth knowing:

  • PyPI's sanitizer drops <source> entirely (verified with readme_renderer, the library PyPI itself uses), so only the <img> fallbacks decide what shows there — PyPI gets the light chart either way, and dark mode is not recoverable through link changes. The srcset URLs change too, so GitHub's dark variants stay spelled the same way as their light siblings.
  • The URLs name the main branch, so the charts track main: replacing an image later also changes it on already-published PyPI pages. Pinning a tag would avoid that at the cost of an edit every release.

Verification: all ten URLs return 200; rendering the new README through readme_renderer leaves zero relative <img src> (was five); the file is byte-identical to main apart from those ten addresses, and the <picture> / <source> / <img> counts are unchanged, so GitHub rendering is untouched.

Supersedes #444, which did this before the query-cost chart was added and was closed with a note about indexing behaviour that does not apply to a README image change.

pyproject publishes README.md as the PyPI description, and PyPI does not
resolve a relative path against the GitHub repo — the five charts render
as broken images on the project page (verified on 0.2.14). Every chart
now loads from raw.githubusercontent.com; the ten other images in the
file already did.

PyPI's sanitizer drops <source>, so only the <img> fallbacks matter
there; the srcset URLs change too, to keep GitHub's dark variants
spelled the same way.
@rejojer
rejojer merged commit 2858384 into main Sep 4, 2026
9 checks passed
@rejojer
rejojer deleted the docs/pypi-readme-absolute-images branch September 4, 2026 07:30
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