Fix __init__.py labels in rendered diff listings#2799
Open
shrirajpawar4 wants to merge 3 commits into
Open
Conversation
SamWilsn
reviewed
May 6, 2026
| Path to the Source (if one exists) relative to the project root. | ||
| """ | ||
| return None | ||
| return self._relative_path |
Contributor
There was a problem hiding this comment.
This highlights an interesting problem with docc... relative_path is supposed to point to an on-disk file, but we also use it to compute the display name.
Comment on lines
+239
to
+241
| - name: Run docc diff regression test | ||
| run: uv run --group test --group doc pytest tests/spec_tools/test_docc.py | ||
|
|
Contributor
There was a problem hiding this comment.
I take it CI failed because docc wasn't part of the test group? Would it make more sense to just add docc to the test group?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix diff Browse labels for package modules so
__init__.pyis displayed correctly instead ofindex.What changed
__init__.pyas the listing path for diff sourcesindexas the emitted output path so diff URLs remain unchangedWhy
The diff renderer was reusing the rewritten output path (
.../index) as the visible listing path. That caused Browse sections on diff pages to showindexinstead of__init__.pyfor packagemodules.
This change fixes the label at the source metadata layer while preserving existing generated diff URLs like
.../index.html.Testing
uv run --group test --group doc pytest tests/spec_tools/test_docc.pyjust docs-specVerified in generated docs that pages such as
diffs/bpo5/amsterdam/vm/index.htmlnow show__init__.pyin the Browse section.Closes #2788