Skip to content

Keep every README link working on the package page - #87

Merged
QuiteYellow merged 1 commit into
mainfrom
fix/readme-links-render-on-pypi
Sep 12, 2026
Merged

QuiteYellow merged 1 commit into
mainfrom
fix/readme-links-render-on-pypi

Conversation

@QuiteYellow

Copy link
Copy Markdown
Owner

pyproject sets readme = "README.md", so the README is also the package's PyPI description. PyPI renders it standalone with no base URL, so a relative path resolves against pypi.org and 404s. GitHub resolves the same path against the repository, which is why a relative link looks correct in review and is dead on the package page.

Four were relative: the three docs/ links I added with the API reference in #86, and LICENSE, which predates them. The intro's ocf-pki-laundry link was already absolute, which is the trace of someone hitting this before.

Nothing is broken in public. v0.1.17 is e0b4843 and the #86 merge came after it, so the three new links have never been published. They would have shipped with the next release.

The guard

A test walks every link in the README and holds three rules:

  • no relative paths, since PyPI cannot resolve them;
  • an absolute link into this repository points at a file that exists;
  • an intra-document anchor matches a heading on the page, reusing the slug function the API reference already uses.

I checked it by reintroducing each fault in turn and watching the test fail on each.

The third rule matters for the README split discussed separately: the one intra-document link here points at Part 2, and moving that section would break it silently, since GitHub renders the page and simply does not scroll.

Validation

797 tests pass on Python 3.11, 3.12, 3.13 and 3.14, and on the dependency floor. The shipped sdist's PKG-INFO, which is the text PyPI renders, carries 28 markdown links and no relative ones.

pyproject sets `readme = "README.md"`, so the README is also the PyPI
description. PyPI renders it standalone with no base URL, so a relative
path resolves against pypi.org and 404s, while GitHub resolves the same
path against the repository. A relative link therefore looks correct in
review and is dead on the package page.

Four were relative: the three docs links I added with the API reference
yesterday, and LICENSE, which predates them. The intro's ocf-pki-laundry
link was already absolute, which is the trace of someone hitting this
before. All four are absolute now.

Nothing was broken in public: v0.1.17 predates the docs commit, so the
three new links have never been published. They would have shipped with
the next release.

A test walks every link in the README and holds three rules: no relative
paths, an absolute link into this repository must point at a file that
exists, and an intra-document anchor must match a heading. Verified by
reintroducing each fault in turn. The shipped sdist's PKG-INFO, which is
what PyPI renders, now carries 28 links and no relative ones.
@QuiteYellow
QuiteYellow merged commit 5b44265 into main Sep 12, 2026
8 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