Skip to content

Commit 5ce181a

Browse files
committed
Download pyAMReX Stubs
1 parent 8084259 commit 5ce181a

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

docs/source/conf.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,8 @@
216216
# Copy .pyi interface files and make them available as .py files
217217
# path to .pyi files w/o having them installed
218218
src_path = "../../src/python/impactx"
219-
dst_path = os.path.join(
220-
os.path.dirname(os.path.abspath(__file__)), "_static/pyapi/impactx"
221-
)
219+
api_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "_static/pyapi")
220+
dst_path = os.path.join(api_path, "impactx")
222221
if os.path.exists(dst_path) and os.path.isdir(dst_path):
223222
shutil.rmtree(dst_path)
224223
shutil.copytree(src_path, dst_path)
@@ -235,3 +234,12 @@
235234

236235
# insert into PYTHONPATH
237236
sys.path.insert(0, os.path.join(dst_path, ".."))
237+
238+
# make archive for download of dependent Sphinx projects
239+
shutil.make_archive(dst_path, "zip", dst_path)
240+
241+
# Download pyAMReX stub files
242+
url = "https://pyamrex.readthedocs.io/en/latest/_static/pyapi/amrex.zip"
243+
amr_path = os.path.join(api_path, "amrex.zip")
244+
urllib.request.urlretrieve(url, amr_path)
245+
shutil.unpack_archive(amr_path, os.path.join(api_path, "amrex"))

0 commit comments

Comments
 (0)