MCPcopy Index your code
hub / github.com/python/cpython / buildPythonDocs

Function buildPythonDocs

Mac/BuildScript/build-installer.py:1088–1130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1086
1087
1088def buildPythonDocs():
1089 # This stores the documentation as Resources/English.lproj/Documentation
1090 # inside the framework. pydoc and IDLE will pick it up there.
1091 print("Install python documentation")
1092 rootDir = os.path.join(WORKDIR, '_root')
1093 buildDir = os.path.join('../../Doc')
1094 docdir = os.path.join(rootDir, 'pydocs')
1095 curDir = os.getcwd()
1096 os.chdir(buildDir)
1097 runCommand('make clean')
1098
1099 # Search third-party source directory for a pre-built version of the docs.
1100 # Use the naming convention of the docs.python.org html downloads:
1101 # python-3.9.0b1-docs-html.tar.bz2
1102 doctarfiles = [ f for f in os.listdir(DEPSRC)
1103 if f.startswith('python-'+getFullVersion())
1104 if f.endswith('-docs-html.tar.bz2') ]
1105 if doctarfiles:
1106 doctarfile = doctarfiles[0]
1107 if not os.path.exists('build'):
1108 os.mkdir('build')
1109 # if build directory existed, it was emptied by make clean, above
1110 os.chdir('build')
1111 # Extract the first archive found for this version into build
1112 runCommand('tar xjf %s'%shellQuote(os.path.join(DEPSRC, doctarfile)))
1113 # see if tar extracted a directory ending in -docs-html
1114 archivefiles = [ f for f in os.listdir('.')
1115 if f.endswith('-docs-html')
1116 if os.path.isdir(f) ]
1117 if archivefiles:
1118 archivefile = archivefiles[0]
1119 # make it our 'Docs/build/html' directory
1120 print(' -- using pre-built python documentation from %s'%archivefile)
1121 os.rename(archivefile, 'html')
1122 os.chdir(buildDir)
1123
1124 htmlDir = os.path.join('build', 'html')
1125 if not os.path.exists(htmlDir):
1126 # Create virtual environment for docs builds with blurb and sphinx
1127 runCommand('make venv')
1128 runCommand('make html PYTHON=venv/bin/python')
1129 os.rename(htmlDir, docdir)
1130 os.chdir(curDir)
1131
1132
1133def buildPython():

Callers 1

mainFunction · 0.85

Calls 11

runCommandFunction · 0.85
getFullVersionFunction · 0.85
shellQuoteFunction · 0.85
listdirMethod · 0.80
joinMethod · 0.45
startswithMethod · 0.45
endswithMethod · 0.45
existsMethod · 0.45
mkdirMethod · 0.45
isdirMethod · 0.45
renameMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…