Description
I noticed a bad interaction today. In my "magic-wormhole" project (which uses versioneer), I created a new virtualenv and ran "pip install -e .". The project uses an entrypoint, and it wrote the entrypoint script into venv/bin/wormhole. The generated script looks like:
#!/Users/warner/stuff/tahoe/magic-wormhole/ve/bin/python2.7
# EASY-INSTALL-ENTRY-SCRIPT: 'magic-wormhole==0.2.0+22.g894da44.dirty','console_scripts','wormhole'
__requires__ = 'magic-wormhole==0.2.0+22.g894da44.dirty'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('magic-wormhole==0.2.0+22.g894da44.dirty', 'console_scripts', 'wormhole')()
)
This works fine until I make a commit, which changes the version that setup.py version
reports into something different than the one frozen into the entrypoint script. After making a commit, running the script gives me an error:
pkg_resources.DistributionNotFound: The 'magic-wormhole==0.2.0+22.g894da44.dirty' distribution was not found and is required by the application
That makes me sad: if I want to use the virtualenv for testing the executable, I have to re-run pip install -e .
after basically every commit.
I think one workaround might be to avoid entrypoints and just use a regular scripts=
argument (in setup.py), with a small executable that does a plain import-and-run. I haven't been able to come up with a better idea.