An existing project is setup in a way that the repository has an __init__.py
in at the root folder. I would like to create a setup.py
in the repository so this would be the resulting project structure:
project-master/
├── __init__.py
├── setup.py
└── submodule1
├── code.py
└── __init__.py
└── submodule2
├── code.py
└── __init__.py
and you should be able to:
git clone project.url
cd project-master
pip install -e .
from project.submodule1 import ...
I tried the hacky solution of temporarily copying the contents in a subfolder so that setup.py
is one level up from the package folder and installing from there. This works well if I pip install .
but unfortunately this solution doesn't work in editable mode because I delete the temporary folder after installing.
Question: What is the right way to create a proper setup.py
that works in editable mode and lives in the same root folder as the package's __init__.py
?