Description
Originally reported by Buck Evan (Bitbucket: bukzor, GitHub: bukzor)
The essential idea is that there's this nifty feature in coverage, but it's too hard to use: http://nedbatchelder.com/code/coverage/subprocess.html
Plopping the pth file in the right spot isn't straightforward code that everyone can write without flaw. It should be a (tested) part of the coveragepy project.
I have a patch for this, but want to get your design guidance before I submit it. There's an interesting fact: there's no reliable way to uninstall a pth file in the case of easy-install
or setup.py develop
/pip install -e
. The wheel and pip install
cases work just fine, which are (I hope!) the usual cases.
Given that fact, what fallback should we (I) provide in these cases? There are three basic choices:
- Throw an error. I think this will break too many people, cause too much trouble, but you might like it best.
- Disable the $COVERAGE_PROCESS_START feature, possibly with a warning. This may be the most sane thing to do, but might be surprising.
- Design the .pth file such that it can be left behind (if coveragepy is uninstalled) without causing any error. This is 100% possible, but means that the install/uninstall aren't exactly inverse in the case of easy-install/develop. I believe this is the most user-friendly choice.
All three are fairly easy to implement. I just need you to pick your favorite, if you would.