Skip to content

Rewrite RTD configuration to use build.jobs rather than build.commands - #149429

Merged
zware merged 7 commits into
python:mainfrom
zware:rewrite_rtd_config
May 6, 2026
Merged

Rewrite RTD configuration to use build.jobs rather than build.commands#149429
zware merged 7 commits into
python:mainfrom
zware:rewrite_rtd_config

Conversation

@zware

@zwarezware commented May 5, 2026

Copy link
Copy Markdown
Member

No description provided.

@zware
zwareforce-pushed the rewrite_rtd_config branch 2 times, most recently from dfcae69 to 7438633CompareMay 5, 2026 20:02
Comment thread.readthedocs.yml
then
base_branch=main;
git fetch --depth=50 origin $base_branch;
for attempt in $(seq 10);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @StanFromIreland added a bash script for progressive unshallowing some time ago based on my experiments elsewhere. We could probably reuse that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, he embedded bash in YAML: #147975 (comment). But perhaps, if it's extracted into Tools/, we could deduplicate the logic.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deduplicating sounds good, but I think I'll leave that for a later cleanup.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. A follow-up sounds good.

Comment thread.readthedocs.yml Outdated
zwareand others added 2 commits May 5, 2026 15:45
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Comment thread.readthedocs.yml Outdated
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
@zware
zware marked this pull request as ready for review May 5, 2026 20:58
@zware
zware requested a review from AA-Turner as a code ownerMay 5, 2026 20:58
@bedevere-app

Copy link
Copy Markdown

GH-149432 is a backport of this pull request to the 3.14 branch.

@zware

zware commented May 5, 2026

Copy link
Copy Markdown
MemberAuthor

Opened the backport ahead of time because it needs to be manually adjusted anyway, and I want to make sure it doesn't do anything too weird on the 3.14 branch.

zware added a commit to zware/cpython that referenced this pull request May 5, 2026
zware added a commit to zware/cpython that referenced this pull request May 5, 2026
… build.commands (pythonGH-149429)
no --set-upstream, add explicit origin/?
Comment thread.readthedocs.yml
set -eEux;
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ];
then
base_branch=main;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an env var that could be used instead of main? I imagine this isn't going to work well in backport PRs unless we check against stable branches.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My plan is to manually set base_branch to the right branch in each backport; I'm afraid RTD doesn't provide the base branch anywhere (that's documented, anyway).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, that works as a workaround. Though, I'd rather have RTD fix it.

curl -s https://api.github.com/repos/python/cpython/pulls/149429 | jq --raw-output '.base.ref' will get you what you want unless they rate-limit you (which is likely).


GHA provides a GITHUB_EVENT_PATH env var with a file path to the entire webhook payload. RTD should do the same so that people wouldn't have to ask them to expose every single bit that GH sends them w/o additional API requests one by one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I just saw this discussion, I wrote #150690 with it.

@webknjazwebknjaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be merged, keeping in mind possible follow-up improvements in the future.

…commands
Add explicit local branch name needed in backports
@read-the-docs-community

read-the-docs-communityBot commented May 6, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32563876 | 📁 Comparing 569bf42 against main (f6d16a0)

🔍 Preview build

9 files changed · ± 9 modified

±Modified

…commands
Avoid "refname 'origin/main' is ambiguous" warnings
Comment thread.readthedocs.yml
zware added a commit to zware/cpython that referenced this pull request May 6, 2026
@zware
zware merged commit 1dcc546 into python:mainMay 6, 2026
49 checks passed
@zware
zware deleted the rewrite_rtd_config branch May 6, 2026 15:44
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@zware@webknjaz@StanFromIreland