I have a Python application with which I would like to distribute a command line binary and its dependent libs. My application shells out to this binary, so I need to know where it and its libs are.
Up to now licensing was an issue and the party installing my app had to get this utility separately, and the assumption that /usr/local/bin
and /usr/local/lib
(or similar) were used was working just fine. The licensing issue has been cleared up (yay!) but now I need to manage this, and I wonder if there's a standard practice and/or if there's a way to have distutils do it for me. Should I still be sending the files to standard locations? Or should they go to, e.g. /usr/local/lib/python2.7/dist-packages/{My_app}/
?
PythonDocs suggest:
/usr/local/lib/pythonX.Y/site-packages
for system-wide installations (Unix) and:userbase/lib/pythonX.Y/site-packages
for user-based installations, where userbase in my case (Linux) is$HOME/.local
.Regarding compiled extensions, they normaly end in
$PREFIX/lib/python2.7/lib-dynload
and executable scripts under$PREFIX/bin
(Linux).Normaly this kind of stuff gets handled by your distutil-package. Just write a correct
setup.py
file and most of this stuff gets handled automagically.The only draw-back is, that the future of python-packaging is not really definite atm and documentation is somewhat confussing and not up to date.
A good startin point is probably: Hitchhiker’s Guide to Packaging