()
| 1086 | |
| 1087 | |
| 1088 | def 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 | |
| 1133 | def buildPython(): |
no test coverage detected
searching dependent graphs…