Skip to content

Commit e3912cc

Browse files
committed
Skip prerelease versions in active Python releases table
1 parent ff694b7 commit e3912cc

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

apps/downloads/templatetags/download_tags.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ def render_active_releases():
197197
if status == "feature":
198198
status = "pre-release"
199199

200-
# Skip releases that are only planned with no pre-release yet
201-
if status == "planned":
200+
# Skip releases not yet in development
201+
if status in ("planned", "prerelease"):
202202
continue
203203

204204
if status == "end-of-life":

apps/downloads/tests/test_template_tags.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"3.10": {"status": "security", "end_of_life": "2026-10-04", "pep": 619},
1616
"3.14": {"status": "bugfix", "first_release": "2025-10-07", "end_of_life": "2030-10", "pep": 745},
1717
"3.15": {"status": "feature", "first_release": "2026-10-01", "end_of_life": "2031-10", "pep": 790},
18-
"3.16": {"status": "planned", "first_release": "2027-10-06", "end_of_life": "2032-10", "pep": 826},
18+
"3.16": {"status": "prerelease", "first_release": "2027-10-06", "end_of_life": "2032-10", "pep": 826},
19+
"3.17": {"status": "planned", "first_release": "2028-10-05", "end_of_life": "2033-10"},
1920
}
2021

2122

@@ -236,14 +237,15 @@ def test_eol_status_includes_last_release_link(self, mock_get_data):
236237
self.assertIn("<a href=", status)
237238

238239
@mock.patch("apps.downloads.templatetags.download_tags.get_release_cycle_data")
239-
def test_planned_releases_excluded(self, mock_get_data):
240-
"""Test that planned releases are not shown."""
240+
def test_planned_and_prerelease_releases_excluded(self, mock_get_data):
241+
"""Test that planned and prerelease releases are not shown."""
241242
mock_get_data.return_value = MOCK_RELEASE_CYCLE
242243

243244
result = render_active_releases()
244245

245246
versions = [r["version"] for r in result["releases"]]
246247
self.assertNotIn("3.16", versions)
248+
self.assertNotIn("3.17", versions)
247249

248250
@mock.patch("apps.downloads.templatetags.download_tags.get_release_cycle_data")
249251
def test_api_failure_returns_empty_releases(self, mock_get_data):

0 commit comments

Comments
 (0)