Docs: Replace hardcoded SOURCE_URI with patchlevel check#150850
Conversation
| # ------------------------------- | ||
|
|
||
| v = get_header_version_info() | ||
| branch = "main" if v.releaselevel == "alpha" else f"{v.major}.{v.minor}" |
There was a problem hiding this comment.
We already calculate the version above, can we re-use that?
Lines 78 to 81 in 6453065
There was a problem hiding this comment.
They're strings like "3.16" and "3.16.0a0". I suppose we could do "a" in release, but it's cleaner to check releaselevel.
But we can clean up these imports: no need for importlib.import_module because we've already done sys.path.append(os.path.abspath('tools/extensions')).
|
I tested it in the preview by going to this section and clicking the last link and I can confirm it works :-) |
|
Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
Sorry, @hugovk, I could not cleanly backport this to |
|
Sorry, @hugovk, I could not cleanly backport this to |
|
Sorry, @hugovk, I could not cleanly backport this to |
|
GH-150855 is a backport of this pull request to the 3.15 branch. |
|
GH-150856 is a backport of this pull request to the 3.14 branch. |
|
GH-150857 is a backport of this pull request to the 3.13 branch. |
During yesterday's 3.15.0b2 release, the reminder to update
SOURCE_URItriggered.SOURCE_URIis used for linking stdlib pages such as:But this reminder was meant to happen during b1, when the
3.15branch is created. It happened during b1 for 3.14.See #150783 (comment).
The cause of this was this fix: python/release-tools#379.
But rather than updating release-tools to trigger the reminder during b1 (and it's a disruptive reminder), let's remove the hardcoding in
SOURCE_URIaltogether, and replace it with a check for the release level:mainas it is now, pre-a1): link tomain.3.x.And we do this directly where it's used in
conf.pyinstead of inpyspecfic.pyand importing from there.Also remove a bunch of unused imports
pyspecfic.py.