Skip to content

Commit ff8c172

Browse files
committed
docs: packages: generate_packages_doc.py: fix paths, registry URLs
Use simpler logic and the new proxy URL for the package registry when generating docs. AI-Generated: Uses Claude Sonnet 5 Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
1 parent c781ade commit ff8c172

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

docs/packages/generate_packages_doc.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,7 @@
1717
GITLAB_WHEEL_BUILDER_URL = (
1818
"https://gitlab.com/riseproject/python/wheel_builder/-/tree/main"
1919
)
20-
21-
# YAML source still lives in the old wheel_builder repo for now.
22-
YAML_SRC_DIR = os.path.normpath(
23-
os.path.join(
24-
os.path.dirname(os.path.abspath(__file__)),
25-
"..", "..", "..", "wheel_builder", "docs", "source", "packages",
26-
)
27-
)
20+
PYPI_INDEX_URL = "https://pypi.riseproject.dev/simple/"
2821

2922
# Match RST inline external refs: `Label <url>`_ or `Label <url>`__
3023
RST_LINK_RE = re.compile(r"`([^`<]+?)\s*<([^>]+)>`_+")
@@ -168,11 +161,10 @@ def generate_md_page(yaml_file, output_md, package_list):
168161
lines.append("")
169162

170163
install_command = (
171-
f"pip install {package_name} "
172-
f"--index-url {GITLAB_REGISTRY_URL}/pypi/simple"
164+
f"pip install {package_name} --index-url {PYPI_INDEX_URL}"
173165
if is_latest
174166
else f"pip install {package_name}=={version_number} "
175-
f"--index-url {GITLAB_REGISTRY_URL}/pypi/simple"
167+
f"--index-url {PYPI_INDEX_URL}"
176168
)
177169
lines += ["```bash", install_command, "```", ""]
178170

@@ -231,12 +223,12 @@ def generate_md_page(yaml_file, output_md, package_list):
231223

232224

233225
def process_all_yaml_files(package_list):
234-
yaml_files = sorted(glob.glob(os.path.join(YAML_SRC_DIR, "*.yaml")))
226+
out_dir = os.path.dirname(os.path.abspath(__file__))
227+
yaml_files = sorted(glob.glob(os.path.join(out_dir, "*.yaml")))
235228
if not yaml_files:
236-
print(f"No YAML files found in {YAML_SRC_DIR}")
229+
print(f"No YAML files found in {out_dir}")
237230
return
238231

239-
out_dir = os.path.dirname(os.path.abspath(__file__))
240232
package_entries = []
241233
for yaml_file in yaml_files:
242234
base = os.path.basename(yaml_file).replace(".yaml", ".md")

0 commit comments

Comments
 (0)