FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Docs: Fix build preview banner by hugovk · Pull Request #104082 · python/cpython · GitHub

/ cpython Public

Docs: Fix build preview banner - #104082

Closed
hugovk wants to merge 1 commit into
python:mainfrom
hugovk:docs-banner
Closed

Docs: Fix build preview banner#104082
hugovk wants to merge 1 commit into
python:mainfrom
hugovk:docs-banner

Conversation

hugovk commented May 2, 2023

Copy link
Copy Markdown
Member

There should be a banner at the top of PR build previews for docs. Here's it working on this branch as a PR on my fork:

But for some reason it's missing for this upstream:

TODO

The code to control this:

cpython/Doc/conf.py

Lines 117 to 124 in f0ad456

# Deployment preview information
# (See .readthedocs.yml and https://docs.readthedocs.io/en/stable/reference/environment-variables.html)
repository_url = os.getenv("READTHEDOCS_GIT_CLONE_URL")
html_context = {
"is_deployment_preview": os.getenv("READTHEDOCS_VERSION_TYPE") == "external",
"repository_url": repository_url.removesuffix(".git") if repository_url else None,
"pr_id": os.getenv("READTHEDOCS_VERSION")
}

Let's start with a draft PR to debug the env vars.

hugovk commented May 2, 2023

Copy link
Copy Markdown
Member Author

It's working here too:

https://cpython-previews--104082.org.readthedocs.build/en/104082/


Looking at another PR build that is missing the banner:

The RtD build page says:

Configure your documentation builds! Adding a .readthedocs.yaml file to your project is the recommended way to configure your documentation builds. You can declare dependencies, set up submodules, and many other great features.

And looking at the PR, it's from before the #103843 was merged that updated conf.py, so I think we're good here.

One thing to do though, is backport #103843 to at least 3.11 so we get banners on backport builds too.

hugovk commented May 2, 2023

Copy link
Copy Markdown
Member Author

Backport PR: #104083

hugovk closed this May 2, 2023
hugovk deleted the docs-banner branch May 24, 2023 15:48
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL