I am having this project structure:
.
├── README.md
├── my_project
│ ├── __init__.py
│ ├── config.py
│ ├── integrations
│ │ ├── __init__.py
│ │ └── google_places.py
├── requirements.txt
└── scripts
└── my_script.py
In my_script.py I have:
from my_project.integrations.google_places import GooglePlaces
However I get the following error when running python scripts/my_script.py:
ModuleNotFoundError: No module named 'my_project'
Locally I can pip install -e . my package (by adding a setup.py to the mix), however since I need to run this from GitHub Actions it feels it doesn't make sense to pursue the same avenue.
I've been reading about manipulating sys.path, but it seems a bit hackish.
Since this is a fairly common setup (I guess), what's the recommended way of fixing the above error? I can alter the project structure if it would make sense.