From e168ba52b19cbaaa7f64cafd7fea7417614eed50 Mon Sep 17 00:00:00 2001 From: Pedro Brochado Date: Thu, 27 Jun 2024 10:12:36 -0300 Subject: [PATCH] Fix problem with nested packages not showing --- src/pulp_docs/mkdocs_macros.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pulp_docs/mkdocs_macros.py b/src/pulp_docs/mkdocs_macros.py index 9ea8ab9..5456270 100644 --- a/src/pulp_docs/mkdocs_macros.py +++ b/src/pulp_docs/mkdocs_macros.py @@ -93,14 +93,19 @@ def prepare_repositories(TMPDIR: Path, repos: Repos, config: Config): ``` """ - # Download/copy source code to tmpdir repo_sources = TMPDIR / "repo_sources" repo_docs = TMPDIR / "repo_docs" api_src_dir = TMPDIR / "api_json" shutil.rmtree(repo_sources, ignore_errors=True) shutil.rmtree(repo_docs, ignore_errors=True) - for repo_or_pkg in repos.all: + # assure subpackages are last, because they depend on their repo parent + subpackages = [s for s in repos.all if isinstance(s, SubPackage)] + normal_repos = [s for s in repos.all if not isinstance(s, SubPackage)] + all_repos = normal_repos + subpackages + + # Download/copy source code to tmpdir + for repo_or_pkg in all_repos: start = time.perf_counter() # handle subpcakges nested under repositories this_docs_dir = repo_docs / repo_or_pkg.name