set default installation prefix in setup.py

Bug #596241 reported by Didier Roche-Tolomelli
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Quickly
Triaged
Wishlist
Unassigned

Bug Description

My python application has a setup file generated with quickly.
when I run setup.py with no arguments for installation prefix, It installs the app in /usr/local, but update_data_directory() function sets data path ( to a non-exsistant folder) in /usr/share, so the app looks for installed files in /usr.
But when I set the installation path using --prefix option, the app will be installed correctly.
Is there any way to set a default installation prefix in the setup.py file, so that InstallAndUpdateDataDirectory() function uses that when no prefix is specified in command line?
Thanks in advance.

Changed in quickly:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Umang Varma (umang) wrote :

I'm not very sure of how python-distutils-extra works, but I have the feeling it is uses the standard distuils not behaves like it. So any Ubuntu/Debian changes made to that will affect python-distutils-extra also.

The installation root in Ubuntu/Debian by default is /usr/local. However, it is supposed to be sys.prefix (which is most probably /usr/ on your computer). I'm going to put a small note on the Debian wiki about this.

http://old.nabble.com/python2.6-related-changes-p22123330.html

Now I really don't know a good way to deal with this. Hardcoding /usr/local would not be nice, because it may not affect other distros. Furthermore, when building a Debian package distutils is called with the --instal-layout=deb option. This means that data files will actually be installed into /usr/share/foo.

What I've done once is to have a list of places the data file can be found - sys.prefix, /usr/local and local directory (if run from inside the DVCS branch). A nice function somewhere inside the template would be nice so that projects call easily call this function and retrieve this list. (Maybe the developer can add the local directory manually, if the directory structure inside /usr/share/foo and and the local directory vary.

What I'm calling local directory would be `quickly_root_directory` in main quickly script.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.