From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 29 Jan 2024 21:30:22 +0000 (+0100) Subject: [3.12] Set `hosted_on` for Read the Docs builds (GH-114697) (#114734) X-Git-Tag: v3.12.2~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=424df31f00e2106eab6b8e747fc4695b00787fe5;p=thirdparty%2FPython%2Fcpython.git [3.12] Set `hosted_on` for Read the Docs builds (GH-114697) (#114734) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- diff --git a/Doc/conf.py b/Doc/conf.py index e05741479dbf..5cc8f7e599af 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -6,7 +6,9 @@ # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable (module imports are okay, they're removed automatically). -import sys, os, time +import os +import sys +import time sys.path.append(os.path.abspath('tools/extensions')) sys.path.append(os.path.abspath('includes')) @@ -49,7 +51,7 @@ manpages_url = 'https://manpages.debian.org/{path}' # General substitutions. project = 'Python' -copyright = '2001-%s, Python Software Foundation' % time.strftime('%Y') +copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation" # We look for the Include/patchlevel.h file in the current Python source tree # and replace the values accordingly. @@ -291,6 +293,9 @@ html_theme_options = { 'root_include_title': False # We use the version switcher instead. } +if os.getenv("READTHEDOCS"): + html_theme_options["hosted_on"] = 'Read the Docs' + # Override stylesheet fingerprinting for Windows CHM htmlhelp to fix GH-91207 # https://github.com/python/cpython/issues/91207 if any('htmlhelp' in arg for arg in sys.argv): @@ -299,7 +304,7 @@ if any('htmlhelp' in arg for arg in sys.argv): print("It may be removed in the future\n") # Short title used e.g. for