On Thu, Mar 25, 2010 at 1:07 PM, Martin Raspaud <martin.rasp...@smhi.se> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Tarek Ziadé skrev: >> On Thu, Mar 25, 2010 at 12:15 PM, Hugo Doria <hugodo...@gmail.com> wrote: >>> On Wed, Mar 24, 2010 at 11:37 PM, P.J. Eby <p...@telecommunity.com> wrote: >>>> You're using a package_dir with more than one entry in it, which is a sign >>>> that your project's layout is broken. If you wanted a layout like the one >>>> you describe here, you need to: >>> What would be the best layout for this? How should i reorganize my project? >>> >> >> We've tried to document this here with what people usually do : >> http://guide.python-distribute.org/creation.html#directory-layout >> >> Feedback welcome ! > > Nice guide !
Thanks ! HTH > > One question though: where should I place configuration files for the package, > and how to handle this in setup.py ? There's no good way to do it, the way we handle these files in distutils is inefficient, but we are working on this for distutils2. Today what you can do (that's what I do but maybe others have a better way to handle this): It depends if you are targeting all platforms or just linux. For all platforms, I would put it *inside* the package so I can get it back using the __file__ variable, no matter if the package is installed or in development. That doesn't work with setuptools or distribute and zipped eggs, but setuptools has some APIs to do it (so you can get the resource file from the zip) -- I expect PJE to give you more details on this if he sees the mail. For linux-only, I install it in /etc, via data_file (see http://docs.python.org/distutils/setupscript.html#installing-additional-files), then I look for the file in the code in that place, with a local fallback. btw, you can probably add an issue here for the guide about it: http://bitbucket.org/tarek/hitchhiker-guide-packaging/issues/ so we can add a section in the guide about this issue. Regards Tarek -- Tarek Ziadé | http://ziade.org _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig