Skip to content

docs: write README links absolute so they resolve on PyPI - #191

Merged
lesnik512 merged 1 commit into
mainfrom
chore/readme-absolute-links
Sep 7, 2026
Merged

docs: write README links absolute so they resolve on PyPI#191
lesnik512 merged 1 commit into
mainfrom
chore/readme-absolute-links

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Implements modern-python/.github#85 for this repo.

Why

README.md is this package's PyPI long description, and PyPI does not rewrite relative links: it
resolves them against https://pypi.org/project/<name>/. Relative links here therefore 404 on the
package page while resolving correctly in the checkout, which is why the offline link gate is green
on them and always has been. The gate answers a different question than the package page asks.

Verified against a live rendered PyPI page rather than inferred from renderer behaviour. Measured
org-wide, 23 of 25 published packages carry relative README links, all dead on their package pages.

Design

Relative links become absolute blob/main/ self-links, or tree/main/ for a directory. The
--remap added in modern-python/.github#82 resolves those against the working tree, so the gate
keeps checking them rather than excluding them as external. Coverage is unchanged.

main rather than a release tag: a tag would stay correct in each frozen long description, but
modern-python/.github#82 deliberately excludes tag-pinned URLs from the gate, and writing the tag in
needs release-time substitution this repo does not have. main bounds the rot to old releases while
keeping every link checked.

The rule goes in AGENTS.md as an instruction rather than a test. CLAUDE.md imports AGENTS.md
here, so it is loaded into every agent turn, which makes it enforcement rather than documentation.
If a relative link appears in a README after this, that judgement is falsified and a test is the
answer. The <repo> placeholder keeps the paragraph byte-identical across all 25 repos.

The Nothing enforces that docstring shape sentence is removed: it described a limitation
without instructing anything, which is the kind of prose AGENTS.md says has no home.

Non-goals

  • No test or lint check enforces the rule
  • No change to relative links outside README.md, which are correct and gate-checked
  • Not applied to .github or the two templates, which publish no long description

Verification

  • No relative Markdown links remain in the README
  • Offline link gate with this repo's remap: 0 errors
  • Lint and tests are left to CI on this PR

@lesnik512
lesnik512 merged commit 1694963 into main Sep 7, 2026
12 checks passed
@lesnik512
lesnik512 deleted the chore/readme-absolute-links branch September 7, 2026 06:31
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