Skip to content

Commit e9dcf48

Browse files
authored
ci/docs: fix copy integration sub-docs (#18921)
1 parent 2b6b594 commit e9dcf48

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.actions/assistant.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,14 +440,14 @@ def copy_replace_imports(
440440
def pull_docs_files(
441441
gh_user_repo: str,
442442
target_dir: str = "docs/source-pytorch/XXX",
443-
checkout: str = "tags/1.0.0",
443+
checkout: str = "refs/tags/1.0.0",
444444
source_dir: str = "docs/source",
445445
as_orphan: bool = False,
446446
) -> None:
447447
"""Pull docs pages from external source and append to local docs."""
448448
import zipfile
449449

450-
zip_url = f"https://github.com/{gh_user_repo}/archive/refs/{checkout}.zip"
450+
zip_url = f"https://github.com/{gh_user_repo}/archive/{checkout}.zip"
451451

452452
with tempfile.TemporaryDirectory() as tmp:
453453
zip_file = os.path.join(tmp, "repo.zip")
@@ -483,7 +483,7 @@ def _copy_rst(rst_in, rst_out, as_orphan: bool = False):
483483
page = fopen.read()
484484
if as_orphan and ":orphan:" not in page:
485485
page = ":orphan:\n\n" + page
486-
with open(rst_in, "w", encoding="utf-8") as fopen:
486+
with open(rst_out, "w", encoding="utf-8") as fopen:
487487
fopen.write(page)
488488

489489

docs/source-app/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
intersphinx_mapping = {
255255
"python": ("https://docs.python.org/3", None),
256256
"torch": ("https://pytorch.org/docs/stable/", None),
257-
# "numpy": ("https://docs.scipy.org/doc/numpy/", None),
257+
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
258258
}
259259

260260
nitpicky = True

docs/source-pytorch/conf.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,20 @@ def _load_py_module(name: str, location: str) -> ModuleType:
9292
assist_local.AssistantCLI.pull_docs_files(
9393
gh_user_repo="Lightning-AI/lightning-Habana",
9494
target_dir="docs/source-pytorch/integrations/hpu",
95-
checkout="tags/1.2.0",
95+
checkout="4eca3d9a9744e24e67924ba1534f79b55b59e5cd", # this is post `refs/tags/1.2.0`
9696
)
9797
assist_local.AssistantCLI.pull_docs_files(
9898
gh_user_repo="Lightning-AI/lightning-Graphcore",
9999
target_dir="docs/source-pytorch/integrations/ipu",
100-
checkout="tags/v0.1.0",
100+
checkout="refs/tags/v0.1.0",
101101
as_orphan=True, # todo: this can be dropped after new IPU release
102102
)
103103
# the IPU also need one image
104104
URL_RAW_DOCS_GRAPHCORE = "https://raw.githubusercontent.com/Lightning-AI/lightning-Graphcore/v0.1.0/docs/source"
105105
for img in ["_static/images/ipu/profiler.png"]:
106-
os.makedirs(os.path.dirname(os.path.join(_PATH_HERE, img)), exist_ok=True)
107-
urllib.request.urlretrieve(f"{URL_RAW_DOCS_GRAPHCORE}/{img}", os.path.join(_PATH_HERE, img))
106+
img_ = os.path.join(_PATH_HERE, "integrations", "ipu", img)
107+
os.makedirs(os.path.dirname(img_), exist_ok=True)
108+
urllib.request.urlretrieve(f"{URL_RAW_DOCS_GRAPHCORE}/{img}", img_)
108109

109110

110111
if _FETCH_S3_ASSETS:

0 commit comments

Comments
 (0)