Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 18, 2023
1 parent 6826620 commit 21563e2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,23 +206,21 @@
# path to .pyi files w/o having them installed
src_path = "../../src/amrex"
dst_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"_static/pyapi/amrex"
os.path.dirname(os.path.abspath(__file__)), "_static/pyapi/amrex"
)
if os.path.exists(dst_path) and os.path.isdir(dst_path):
shutil.rmtree(dst_path)
shutil.copytree(src_path, dst_path)

for subdir, dirs, files in os.walk(dst_path):
for f in files:
if f.find('.pyi') > 0:
if f.find(".pyi") > 0:
dir_path = os.path.relpath(subdir, dst_path)
old_path = os.path.join(dir_path, f)
new_path = old_path.replace(".pyi", ".py")
new_path = old_path.replace(".pyi", ".py")
print(f"old_path={old_path}, new_path={new_path}")
os.replace(
os.path.join(dst_path, old_path),
os.path.join(dst_path, new_path)
os.path.join(dst_path, old_path), os.path.join(dst_path, new_path)
)

# insert into PYTHONPATH
Expand Down

0 comments on commit 21563e2

Please sign in to comment.