Skip to content

Commit

Permalink
Use platform-independent way to add src/ to PYTHONPATH
Browse files Browse the repository at this point in the history
  • Loading branch information
opcode81 committed Aug 13, 2024
1 parent 8ea4462 commit d4baaef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build-docs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export PYTHONPATH="$PYTHONPATH:$(pwd)/src"
export PYTHONPATH="$(python build_scripts/pythonpath.py)"
rm -rf docs/build
rm -rf docs/jupyter_execute
jupyter-book config sphinx docs/
Expand Down
5 changes: 5 additions & 0 deletions build_scripts/pythonpath.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import os

SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))

print(os.environ["PYTHONPATH"] + os.pathsep + os.path.abspath(os.path.join(SCRIPT_DIR, "..", "src")))

0 comments on commit d4baaef

Please sign in to comment.