ensure entrypoint parent folder is in the module search path (#374)
[This SO answer](https://stackoverflow.com/a/62923810) provides good detail about the difference between launching a python file (aka `python app/main.py`) and launching a python module (aka `python -m widget_store.main`). In particular for this PR, launching a file automatically adds the file's parent directory to `sys.path` while launching a module adds the current directory. `dbos debug` was always ensuring the current directory (represented by empty string) was in `sys.path`, so it was failing when attempting to debug a file in a subdirectory. This code fixes that + isolates the change to `sys.path` to only happen for file launch. Module launch does not require `sys.path` changes because `dbos debug` is already launching in the debugger as a module so the current directory will already be on the path
H
Harry Pierson committed
ff2852e3c29f0712047aab516185c45ebabbf473
Parent: 712285e
Committed by GitHub <noreply@github.com>
on 6/2/2025, 11:30:34 PM