Skip to content

Commit

Permalink
Download pyAMReX Stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Jan 30, 2025
1 parent 8fc718f commit e2e9286
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,8 @@
# Copy .pyi interface files and make them available as .py files
# path to .pyi files w/o having them installed
src_path = "../../src/python/impactx"
dst_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "_static/pyapi/impactx"
)
api_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "_static/pyapi")
dst_path = os.path.join(api_path, "impactx")
if os.path.exists(dst_path) and os.path.isdir(dst_path):
shutil.rmtree(dst_path)
shutil.copytree(src_path, dst_path)
Expand All @@ -235,3 +234,12 @@

# insert into PYTHONPATH
sys.path.insert(0, os.path.join(dst_path, ".."))

# make archive for download of dependent Sphinx projects
shutil.make_archive(dst_path, "zip", dst_path)

# Download pyAMReX stub files
url = "https://pyamrex.readthedocs.io/en/latest/_static/pyapi/amrex.zip"
amr_path = os.path.join(api_path, "amrex.zip")
urllib.request.urlretrieve(url, amr_path)
shutil.unpack_archive(amr_path, os.path.join(api_path, "amrex"))

0 comments on commit e2e9286

Please sign in to comment.