Re: Making code run in both source tree and installation path

2009-07-01 Thread Lawrence D'Oliveiro
In message , Robert Kern wrote: > On 2009-07-01 01:04, Carl Banks wrote: >> >> The most common way I've seen people work around this issue is to >> throw their data files into the package directories. Yuck. > > Huh. I always found that to be a more elegant solution than hardcoding the > data lo

Re: Making code run in both source tree and installation path

2009-07-01 Thread Robert Kern
On 2009-07-01 01:04, Carl Banks wrote: On Jun 29, 9:20 am, Javier Collado wrote: I've seen different approaches: - distutils trick in setup.py to modify the installed script (i.e. changing a global variable value) so that it has a reference to the data files location. One of my biggest compl

Re: Making code run in both source tree and installation path

2009-07-01 Thread Carl Banks
On Jun 29, 9:20 am, Javier Collado wrote: > I've seen different approaches: > - distutils trick in setup.py to modify the installed script (i.e. > changing a global variable value) so that it has a reference to the > data files location. One of my biggest complaints about distutils is that it do

Re: Making code run in both source tree and installation path

2009-06-30 Thread ryles
On Jun 29, 12:20 pm, Javier Collado wrote: > Hello, > > I would like to be able to run the main script in a python project > from both the source tree and the path in which it's installed on > Ubuntu. The script, among other things, imports a package which in > turns makes use of some data files t

Re: Making code run in both source tree and installation path

2009-06-29 Thread Lawrence D'Oliveiro
In message , Javier Collado wrote: > - distutils trick in setup.py to modify the installed script (i.e. > changing a global variable value) so that it has a reference to the > data files location. This seems to me to be the cleanest solution, at least as a default. > - Heuristic in the package

Making code run in both source tree and installation path

2009-06-29 Thread Javier Collado
Hello, I would like to be able to run the main script in a python project from both the source tree and the path in which it's installed on Ubuntu. The script, among other things, imports a package which in turns makes use of some data files that contains some metadata that is needed in xml format