|
26 | 26 | from parinx.errors import MethodParsingException |
27 | 27 | import six |
28 | 28 |
|
| 29 | +from script_utils import PROJECT_ROOT |
29 | 30 | from verify_included_modules import get_public_modules |
30 | 31 |
|
31 | 32 |
|
@@ -601,7 +602,7 @@ def main(): |
601 | 602 | parser.add_argument('--tag', help='The version of the documentation.', |
602 | 603 | default='master') |
603 | 604 | parser.add_argument('--basepath', help='Path to the library.', |
604 | | - default=os.path.join(os.path.dirname(__file__), '..')) |
| 605 | + default=PROJECT_ROOT) |
605 | 606 | parser.add_argument('--show-toc', help='Prints partial table of contents', |
606 | 607 | default=False) |
607 | 608 | args = parser.parse_args() |
@@ -635,18 +636,17 @@ def main(): |
635 | 636 | } |
636 | 637 | } |
637 | 638 |
|
638 | | - BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) |
639 | | - BASE_JSON_DOCS_DIR = os.path.join(BASE_DIR, 'docs', 'json') |
| 639 | + BASE_JSON_DOCS_DIR = os.path.join(PROJECT_ROOT, 'docs', 'json') |
640 | 640 |
|
641 | | - DOCS_BUILD_DIR = os.path.join(BASE_DIR, 'docs', '_build') |
| 641 | + DOCS_BUILD_DIR = os.path.join(PROJECT_ROOT, 'docs', '_build') |
642 | 642 | JSON_DOCS_DIR = os.path.join(DOCS_BUILD_DIR, 'json', args.tag) |
643 | 643 | LIB_DIR = os.path.abspath(args.basepath) |
644 | 644 |
|
645 | 645 | library_dir = os.path.join(LIB_DIR, 'google', 'cloud') |
646 | 646 | public_mods = get_public_modules(library_dir, |
647 | 647 | base_package='google.cloud') |
648 | 648 |
|
649 | | - generate_module_docs(public_mods, JSON_DOCS_DIR, BASE_DIR, toc) |
| 649 | + generate_module_docs(public_mods, JSON_DOCS_DIR, PROJECT_ROOT, toc) |
650 | 650 | generate_doc_types_json(public_mods, |
651 | 651 | os.path.join(JSON_DOCS_DIR, 'types.json')) |
652 | 652 | package_files(JSON_DOCS_DIR, DOCS_BUILD_DIR, BASE_JSON_DOCS_DIR) |
|
0 commit comments