I want to organize my Python source code into a monorepo, with the below basic structure:
projectrootdir
- libraryone
- pyproject.toml
- README
- src/orgname/libraryone
- __init__.py
- somemodule.py
- webapi
- pyproject.toml
- README
- src/organame/webapi
- __init__.py
- apimodule.py
In the apimodule.py
file, I want to use modules from libraryone
like so:
from orgname.libraryone import somemodule
As of now, I can’t do this. Instead, the below works:
from libraryone.src.orgname.libraryone import somemodule
In the pyproject.toml
file for webapi
, I have added the below:
[tool.poetry.dependencies]
libraryone = {path = "../libraryone"}
How can I organize and configure this to achieve what I want? Do I need configurations directly under projectroodir
?