[Distutils] Help to create a setup.py (subdirectories aren't working)

Martin Raspaud martin.raspaud at smhi.se
Thu Mar 25 13:33:31 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tarek Ziadé skrev:

>> 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.

Thanks, I think I will go for the local version. It seems to be what setuptools
does anyway.

> 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.

Done.

Regards,
Martin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJLq1gbAAoJEBdvyODiyJI4ShQIAI4KbxpJnowZT7JHaYIHOzzf
aZZ670yUxet4alcwqIgLkVVq2UAsXubfeiJvgq96pn1Fo7ern4hLI9UR4zODNmYg
vqncpGkl9vk1dDZUgtiUpECLaEayqgQv6xDH2m9vbxlCybfbB4YXDeEFUQWz/GKN
xcgz45HYaBVX4v1yoeE+2pz+scZg2TW5jKTDN4PWgA72JicXOJP/wK7BI6ew0tcH
a1BEIGSYYJsNktnC6r0d3BVWeD4amE7sDfp9RgWNCuYjLIiz62fp7lwz9zTwywJ5
m5HbB7t7HcMAhTdyXohD9ky+68JC67Qi0UL7nTPhv4MVzNebM0lr1/7UqaAjl74=
=G2zk
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: martin_raspaud.vcf
Type: text/x-vcard
Size: 259 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20100325/fba12eb5/attachment.vcf>


More information about the Distutils-SIG mailing list