My current setup.py writes the git commit hash in a file which the module can access after it has been installed. However, I would like to disable that when I am developing the module since the setup.py file will not be triggered twice and the hash would be inaccurate. This brings us to the question:
Is there a way to tell from setup.py whether the module is being installed in editable mode? i.e.,
pip install -e .
I found a similar question here, but even the "hack" will not work in my case since the module will be installed directly with git, and the .git
directory will exist even for normal installs during installation.