I have a Git repository cloned into myproject with __init__.py in the root of the repository, which makes all this an importable Python package.
I am trying to write setuptools setup.py for a package that will also be in the root of the repository next to the __init__.py file. I want setup.py set the directory it is located in as a package. It would be nice if setup.py itself was part of the installation, but it would be better if it didn't. Ideally, this should work in editable mode ( pip install -e . )
Is this configuration generally supported? I can make it work by specifying the argument package_dir= {"": ".."}, for setup() and asking it to look for myproject in the directory above the current one. However, this requires that the package is always installed from a directory named myproject , which apparently does not happen if, say, it is installed through pip or someone works with a Git clone named myproject-dev , or in any another number of cases.
Another hack I am considering is a symbolic link to . named mypackage inside the repository. This should work, but I wanted to check if there is a better way in the first place.
source share