Only show pre-releases when a release exists#2998
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the “Active Python releases” rendering logic so that pre-release series (including versions currently marked as planned, feature, or prerelease by the PEPs release-cycle API) are only shown once there is at least one published Release record in the local database—ensuring the “Download” link can resolve to an actual /downloads/latest/pythonX.Y/ target. This addresses the missing Python 3.15 row reported in #2997 after the upstream API status changes.
Changes:
- Update
render_active_releases()to treatplanned/feature/prereleasestatuses as “pre-release”, but only display them when a published DBReleaseexists for that minor version. - Adjust and expand tests to cover the “show once a pre-release ships” behavior and the updated API status mapping assumptions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/downloads/templatetags/download_tags.py | Updates active-releases filtering to show pre-release series only when a matching published DB release exists. |
| apps/downloads/tests/test_template_tags.py | Updates mock API statuses and adds DB-backed tests to validate the new visibility rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
@JacobCoffee Ready for merge when you are :) |
JacobCoffee
approved these changes
Jun 10, 2026
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.
Description
3.15 b1 has just been released. That means 3.16 now exists on the
mainbranch but won't have any releases until it hits alpha in October.python/peps#4962 changed the statuses in the API: https://peps.python.org/api/release-cycle.json
But https://www.python.org/downloads/ now shows 3.16 (but it has no downloads) and is missing 3.15:
Rather than juggling which actual status of the prereleases ("planned", "feature", "prerelease") actually has a release out, let's check if they have a release in the database. Then we know we can definitely link to the downloads page.
Closes