Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

entry_points does not create custom scripts with pip or easy_install in Python?

I am using simple entry points to make a custom script, with this in setup.py:

  entry_points = {
           'my_scripts': ['combine_stuff = mypackage.mymod.test:foo']
  }

where mypackage/mymod/test.py contains:

import argh
from argh import arg
@arg("myarg", help="Test arg.")
def foo(myarg):
    print "Got: ", myarg

When I install my package using this (in same directory as setup.py)

pip install --user -e .

The entry points do not get processed at all it seems. Why is that?

If I install with distribute easy_install, like:

easy_install --user -U .

then the entry points get processed and it creates:

$ cat mypackage.egg-info/entry_points.txt 
[my_scripts]
combine_stuff = mypackage.mymod.test:foo

but no actual script called combine_stuff gets placed anywhere in my bin dirs (like ~/.local/bin/). It just doesn't seem to get made. What is going wrong here? How can I get it to make an executable script, and ideally work with pip too?


1 Answers

The answer was to use console_scripts instead of my_scripts. It was unclear that the scripts name was anything other than internal label for the programmer.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!