I have a package awesomepkg with setup.py. I'd like to install a binary executable awesometool to the command line along with the package itself when users run pip install awesomepkg. I have compiled different OS versions for awesometool, which lives in a bin/ folder beside setup.py.
However, I can't find a good way to configure setup.py. I have attempted the following:
Use the
scripts=[]keyword insetup(). Unfortunately, the "executable" must be a python script.So I try to wrap the binary in a python script using
os.system('bin/awesometool')to delegate. It also fails because the wrapper script is copied somewhere else by pip, so it doesn't know where the relative pathbin/awesometoolis.Another potential solution is the
data_fileskeyword. However, for some reason the data files are not copied over tosite_packagesinstallation dir, even though runningpython setup.py bdist_wheelsays they have been copied.
Reference: https://docs.python.org/3/distutils/setupscript.html