|
46 | 46 | option: nitpicky)
|
47 | 47 | --check-nested check picklability of nested classes in DOCUMENT 'reference'
|
48 | 48 | --no-prune-empty-dirs
|
49 |
| - do not prune empty directories in the documentation sources |
| 49 | + do not prune empty directories in the documentation source |
50 | 50 | --use-cdns assume internet connection and use CDNs; in particular,
|
51 | 51 | use MathJax CDN
|
52 | 52 | -N, --no-colors do not color output; does not affect children
|
@@ -325,7 +325,7 @@ def setup_parser():
|
325 | 325 | help="check picklability of nested classes in DOCUMENT 'reference'")
|
326 | 326 | standard.add_argument("--no-prune-empty-dirs", dest="no_prune_empty_dirs",
|
327 | 327 | action="store_true",
|
328 |
| - help="do not prune empty directories in the documentation sources") |
| 328 | + help="do not prune empty directories in the documentation source") |
329 | 329 | standard.add_argument("--use-cdns", dest="use_cdns", default=False,
|
330 | 330 | action="store_true",
|
331 | 331 | help="assume internet connection and use CDNs; in particular, use MathJax CDN")
|
@@ -508,22 +508,24 @@ def excepthook(*exc_info):
|
508 | 508 |
|
509 | 509 | build_options.ABORT_ON_ERROR = not args.keep_going
|
510 | 510 |
|
| 511 | + # Set up Intersphinx cache |
| 512 | + _ = IntersphinxCache() |
| 513 | + |
| 514 | + builder = get_builder(name) |
| 515 | + |
511 | 516 | if not args.no_prune_empty_dirs:
|
512 | 517 | # Delete empty directories. This is needed in particular for empty
|
513 | 518 | # directories due to "git checkout" which never deletes empty
|
514 | 519 | # directories it leaves behind. See Issue #20010.
|
515 | 520 | # Issue #31948: This is not parallelization-safe; use the option
|
516 | 521 | # --no-prune-empty-dirs to turn it off
|
517 |
| - for dirpath, dirnames, filenames in os.walk(SAGE_DOC_SRC, topdown=False): |
| 522 | + for dirpath, dirnames, filenames in os.walk(builder.dir, topdown=False): |
518 | 523 | if not dirnames + filenames:
|
519 | 524 | logger.warning('Deleting empty directory {0}'.format(dirpath))
|
520 | 525 | os.rmdir(dirpath)
|
521 | 526 |
|
522 |
| - # Set up Intersphinx cache |
523 |
| - _ = IntersphinxCache() |
524 |
| - |
525 |
| - builder = getattr(get_builder(name), typ) |
526 |
| - builder() |
| 527 | + build = getattr(builder, typ) |
| 528 | + build() |
527 | 529 |
|
528 | 530 |
|
529 | 531 | if __name__ == '__main__':
|
|
0 commit comments