This question is a bit outdated, but I hope that my answer will be useful to anyone who finds it the same way I do.
I had the same problem with my package. Apparently, neither setuptools nor pip (my peak 1.5.6 ) explicitly allow permissions. Your option is either permission to change manually, or the transition from scripts to the entry_points parameter.
1) Change file permissions manually
It is complex and complete enough, but should work. The idea is that if the installation process puts your executable in /usr/local/bin , it also has permissions on the chmod file to enable executable flags. From setup.py after your setup() sentence, run something like:
execpath = '/usr/local/bin/yourexec' if os.name is 'posix' and os.path.exists(execpath): os.chmod(execpath, int('755', 8))
2) Migration to entry_points
setuptools offers an option for your setup() called entry_points . It accepts a dictionary with the keys console_scripts and gui_scripts , which you can use as follows:
setup(
This statement will automatically generate the myexecfile , which calls mymainfunction from mymainmodule of mypackage , which can be easily distributed by you.
The mymainfunction you should know is that entry point functions ( mymainfunction in this example) may not have any arguments. If you passed sys.argv your main function from your executable as an argument, you must rewrite the function to extract and parse sys.argv yourself.
Chris Warrick wrote a good article about this feature called Python Apps Right Way , which may seem useful to you.
source share