|
2 | 2 |
|
3 | 3 | """Build the Python docs for various branches and various languages.
|
4 | 4 |
|
5 |
| -Usage: |
6 |
| -
|
7 |
| - build_docs.py [-h] [-d] [-q] [-b 3.7] [-r BUILD_ROOT] [-w WWW_ROOT] |
8 |
| - [--skip-cache-invalidation] [--group GROUP] [--git] |
9 |
| - [--log-directory LOG_DIRECTORY] |
10 |
| - [--languages [fr [fr ...]]] |
11 |
| -
|
12 |
| -
|
13 | 5 | Without any arguments builds docs for all active versions configured in the
|
14 | 6 | global VERSIONS list and all languages configured in the LANGUAGES list,
|
15 | 7 | ignoring the -d flag as it's given in the VERSIONS configuration.
|
@@ -473,14 +465,14 @@ def build_one(
|
473 | 465 | logging.info("Build done for version: %s, language: %s", version.name, language.tag)
|
474 | 466 |
|
475 | 467 |
|
476 |
| -def build_venv(build_root, version): |
| 468 | +def build_venv(build_root, version, theme): |
477 | 469 | """Build a venv for the specific version.
|
478 | 470 | This is used to pin old Sphinx versions to old cpython branches.
|
479 | 471 | """
|
480 | 472 | requirements = [
|
481 | 473 | "blurb",
|
482 | 474 | "jieba",
|
483 |
| - "python-docs-theme", |
| 475 | + theme, |
484 | 476 | "sphinx=={}".format(version.sphinx_version),
|
485 | 477 | ]
|
486 | 478 | venv_path = os.path.join(build_root, "venv-with-sphinx-" + version.sphinx_version)
|
@@ -731,6 +723,12 @@ def parse_args():
|
731 | 723 | action="store_true",
|
732 | 724 | help="Get build_docs and dependencies version info",
|
733 | 725 | )
|
| 726 | + parser.add_argument( |
| 727 | + "--theme", |
| 728 | + default="python-docs-theme", |
| 729 | + help="Python package to use for python-docs-theme: Usefull to test branches:" |
| 730 | + " --theme git+https://github.com/obulat/python-docs-theme@master", |
| 731 | + ) |
734 | 732 | return parser.parse_args()
|
735 | 733 |
|
736 | 734 |
|
@@ -780,7 +778,7 @@ def main():
|
780 | 778 | scope.set_tag("language", language_tag)
|
781 | 779 | language = languages_dict[language_tag]
|
782 | 780 | try:
|
783 |
| - venv = build_venv(args.build_root, version) |
| 781 | + venv = build_venv(args.build_root, version, args.theme) |
784 | 782 | build_one(
|
785 | 783 | version,
|
786 | 784 | args.quick,
|
|
0 commit comments