-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Infra: Move release dates from RSTs to JSON #4314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# .coveragerc to control coverage.py | ||
|
||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_also = | ||
if TYPE_CHECKING: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from pep_sphinx_extensions.pep_processor.html import pep_html_translator | ||
|
||
|
||
def test_create_release_list(): | ||
# Arrange | ||
release_dates = { | ||
"3.14.0 alpha 7": "2025-04-08", | ||
"3.14.0 beta 1": "2025-05-06", | ||
"3.14.0 beta 2": "2025-05-27", | ||
"3.14.0 beta 3": "2025-06-17", | ||
"3.14.0 beta 4": "2025-07-08", | ||
"3.14.0 candidate 1": "2025-07-22", | ||
"3.14.0 candidate 2": "2025-08-26", | ||
"3.14.0 final": "2025-10-07", | ||
} | ||
|
||
# Act | ||
result = pep_html_translator.create_release_list(release_dates) | ||
|
||
# Assert | ||
assert result.splitlines() == [ | ||
'<ul class="simple"><li>3.14.0 alpha 7: Tuesday, 2025-04-08', | ||
"<li>3.14.0 beta 1: Tuesday, 2025-05-06 (No new features beyond this point.)", | ||
"<li>3.14.0 beta 2: Tuesday, 2025-05-27", | ||
"<li>3.14.0 beta 3: Tuesday, 2025-06-17", | ||
"<li>3.14.0 beta 4: Tuesday, 2025-07-08", | ||
"<li>3.14.0 candidate 1: Tuesday, 2025-07-22", | ||
"<li>3.14.0 candidate 2: Tuesday, 2025-08-26", | ||
"<li>3.14.0 final: Tuesday, 2025-10-07</ul>", | ||
] |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the idea for this file to replace e.g. the devguide one, or be used to build the version switcher on d.p.o? If so, I think having the 'official' location be the PEPs repo feels a bit hidden. The devguide feels 'best' as it is non-versioned, but equally we get complaints that that is non-obvious. If we do want a single-data-file-of-truth, I would probably suggest putting all of the devguide fields into this one, as otherwise it gets more complex/annoying with multiple slightly different files describing roughly the same thing. On a practicalities level, I'd suggest using TOML, which has both support for dates, comments, trailing commas, etc and slightly nicer formatting for human consumption. E.g.: [[3.14]]
stage = "development begins"
date = 2024-05-08
actual = true
[[3.14]]
# ...
[[3.14]]
stage = "beta 1"
date = 2025-05-06
actual = false A There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, I'm primarily thinking of replacing the devguide one.
My thinking of it being here is because this is where the equivalent release PEPs are. When the 3.15 PEP is added, it can be done right here in both RST and data file. This is the PEPs spec repo, this is where you come for the release dates now, it feels right the definitive release dates are retained in the same place. TOML, possibly, although that would make it harder to use for example in JavaScript. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"3.14": { | ||
"actual": { | ||
"3.14 development begins": "2024-05-08", | ||
"3.14.0 alpha 1": "2024-10-15", | ||
"3.14.0 alpha 2": "2024-11-19", | ||
"3.14.0 alpha 3": "2024-12-17", | ||
"3.14.0 alpha 4": "2025-01-14", | ||
"3.14.0 alpha 5": "2025-02-11", | ||
"3.14.0 alpha 6": "2025-03-14" | ||
}, | ||
"expected": { | ||
"3.14.0 alpha 7": "2025-04-08", | ||
"3.14.0 beta 1": "2025-05-06", | ||
"3.14.0 beta 2": "2025-05-27", | ||
"3.14.0 beta 3": "2025-06-17", | ||
"3.14.0 beta 4": "2025-07-08", | ||
"3.14.0 candidate 1": "2025-07-22", | ||
"3.14.0 candidate 2": "2025-08-26", | ||
"3.14.0 final": "2025-10-07" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to do this in the AST rather than the writer (e.g HTML)