What is the process for running console scripts that use entry points as a python package developer?
I have a python project that has a setup.py with. In it, I have a
entry_points={
'console_scripts': [
'myscript=mypackage.myscript.__main__:main',
]
},
If I do python setup.py develop, I do end up with the wrapper scripts in virtualenv/bin, but when I run them I get an error:
ImportError: Entry point ('console_scripts', 'myscript') not found
(the above does work if I do pip install .)
Now, from the top of the project, I can copy the wrapper script and manually do:
$ python
Python 3.6.8 (default, Apr 25 2019, 21:02:35)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pkg_resources import load_entry_point
>>> load_entry_point('mypackage', 'console_scripts', 'myscript')
<function main at 0x7f7b971bcea0>
>>>
So, what I take from this is that virtualenv/bin/myscript is looking in the virtualenv for the package and when I run it manually from the top of my dev environment, it looks for packages in my current directory.
I don't want to run it out of my virtualenv though. I don't want to have to do pip install . every time I want to try a modification to my script.
What is the expected workflow here? To manually run python -m mypackage.myscript? I'd rather run it just like users will. Copy the virtualenv/bin scripts? Then they could become out of date...
I am unable to find this aspect of the development workflow in the setuptools docs.
update:
I did find this in my virtualenv after setup.py develop:
$ more virtualenv/lib/python3.6/site-packages/mypackage.egg-link
/home/me/src/mypackage.git
.
./setup.py developtrypip install -e .and see if that works any better.pip uninstall mypackageand rerunsetup.py developand it still works as well. I'll see if I can reproduce.mypackage.egg-info/entry_points.txtwas out of date. But can't reproduce it.