Skip to content

Infra: Link target release to release PEP in PEP 0 - #5058

Merged
hugovk merged 7 commits into
python:mainfrom
BHUVANSH855:fix-4379-pep0-release-links
Jul 28, 2026
Merged

Infra: Link target release to release PEP in PEP 0#5058
hugovk merged 7 commits into
python:mainfrom
BHUVANSH855:fix-4379-pep0-release-links

Conversation

@BHUVANSH855

Copy link
Copy Markdown
Contributor

Summary

This change links Python version entries in PEP 0 to their corresponding release schedule PEPs.

Specifically, it:

  • Builds a mapping from Python versions to release schedule PEP numbers using release-topic metadata.
  • Emits :pep: references for Python version entries when a matching release schedule PEP exists.
  • Falls back to plain text when no matching release schedule PEP is available.
  • Adds a regression test covering the new linking behavior.

Testing

python -m pytest
python build.py

Results:

  • 532 passed, 2 xfailed
  • Documentation build succeeded

Issue

Closes #4379

@BHUVANSH855
BHUVANSH855 requested a review from AA-Turner as a code owner July 25, 2026 15:12
@read-the-docs-community

read-the-docs-community Bot commented Jul 25, 2026

Copy link
Copy Markdown

Documentation build overview

📚 pep-previews | 🛠️ Build #33779846 | 📁 Comparing 16a3eac against latest (9bb3132)

  🔍 Preview build  

7 files changed · ± 7 modified

± Modified

@hugovk hugovk changed the title gh-4379: Link target release to release PEP in PEP 0 Infra: Link target release to release PEP in PEP 0 Jul 26, 2026
@hugovk hugovk added the infra Core infrastructure for building and rendering PEPs label Jul 26, 2026
@hugovk

hugovk commented Jul 26, 2026

Copy link
Copy Markdown
Member

Please also check topic pages such as https://pep-previews--5058.org.readthedocs.build/topic/packaging/, they don't have linked versions.

Is it worth also linking on the release topic page? https://pep-previews--5058.org.readthedocs.build/topic/release/


Some with multiple versions don't get linked:

image

(That "2.6, 3.0" is a link to the joint 2.6/3.0 PEP.)

Add tests to include cases like "2.6, 3.0", "2.7, 3.1" and "2.4, 2.5, 2.6".

@BHUVANSH855

Copy link
Copy Markdown
Contributor Author

Thanks! I've updated the topic pages to use the same release_peps mapping as PEP 0 and the numerical index, so the Python version links are now generated there as well.

I've also added regression tests covering the historical multi-version cases you mentioned:

  • 2.6, 3.0
  • 2.7, 3.1
  • 2.4, 2.5, 2.6

I've verified the changes with python build.py and the full test suite (535 passed, 2 xfailed).

Comment thread pep_sphinx_extensions/tests/pep_zero_generator/test_writer.py Outdated
Comment thread pep_sphinx_extensions/tests/pep_zero_generator/test_writer.py Outdated
@BHUVANSH855
BHUVANSH855 requested a review from hugovk July 26, 2026 17:52
@hugovk

hugovk commented Jul 26, 2026

Copy link
Copy Markdown
Member

Please check the output, there are still unlinked versions.

@BHUVANSH855

Copy link
Copy Markdown
Contributor Author

Please check the output, there are still unlinked versions.

I updated the release PEP mapping to handle release PEPs that cover multiple Python versions (e.g. 2.6, 3.0) by also resolving standalone version lookups when there isn't a dedicated release PEP for that version.

I verified the generated output, and the previously unlinked standalone 2.6 and 3.0 entries are now linked, while existing mappings for versions with dedicated release PEPs (such as 2.7, 3.1, and 3.2) remain unchanged. I also added a regression test for the new mapping logic.

Comment thread pep_sphinx_extensions/tests/pep_zero_generator/test_writer.py Outdated
Comment thread pep_sphinx_extensions/pep_zero_generator/pep_index_generator.py Outdated
Comment thread pep_sphinx_extensions/pep_zero_generator/writer.py Outdated
@BHUVANSH855

Copy link
Copy Markdown
Contributor Author

Thanks! I've incorporated the suggested simplifications.

  • build_release_peps() now stores only individual versions.
  • PEPZeroWriter always links versions individually.
  • Updated the tests to use real release data and added a case for a version without a release PEP.

@BHUVANSH855
BHUVANSH855 requested a review from hugovk July 27, 2026 14:07
Comment thread pep_sphinx_extensions/tests/pep_zero_generator/test_writer.py Outdated
Comment thread pep_sphinx_extensions/tests/pep_zero_generator/test_writer.py
Comment thread pep_sphinx_extensions/pep_zero_generator/writer.py Outdated
Comment thread pep_sphinx_extensions/tests/pep_zero_generator/test_pep_index_generator.py Outdated
Comment thread pep_sphinx_extensions/tests/pep_zero_generator/test_writer.py Outdated
Comment thread pep_sphinx_extensions/tests/pep_zero_generator/test_writer.py Outdated
hugovk added 2 commits July 27, 2026 17:43
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@BHUVANSH855
BHUVANSH855 requested a review from hugovk July 27, 2026 17:40
@hugovk
hugovk merged commit 1019939 into python:main Jul 28, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra Core infrastructure for building and rendering PEPs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link target release to release PEP in PEP 0

2 participants