[Distutils] sandbox violation
Phillip J. Eby
pje at telecommunity.com
Wed Apr 18 17:47:14 CEST 2007
At 08:52 AM 4/18/2007 -0300, Flávio Codeço Coelho wrote:
>Em Ter, 2007-04-17 às 20:04 -0400, Phillip J. Eby escreveu:
>>
>>
>>At 04:16 PM 4/17/2007 -0300, Flávio Codeço Coelho wrote:
>> >Hi,
>> >
>> >I have a setup.py that has recently stopped working with a
>> >sandbox-violation error message. During installation I install files under
>> >/usr/share
>> >
>> >Is installation of file outside the python path forbidden now?
>>
>>It is when an egg is being built, since anything not installed to the
>>temporary directory where the egg is being built will not get included in
>>the egg.
>>
>Is this a recent change to easy_install?
No; it was originally implemented a little less than 2 years ago:
http://svn.python.org/view?rev=41029&view=rev
> cause my packages used to install nicely with easy_instal up to a few
> weeks ago...
Evidently you've changed something else, or you've been using a 2-year-old
version of easy_install. :)
>> >Is ther any workaraound?
>>
>>Don't use easy_install or build an egg. Eggs must be self-contained, and
>>easy_install builds eggs before installing them. That's a feature of eggs
>>-- i.e., they don't put files all over your system.
>
>I agree with this philosophy. But does it mean that if want my packages to
>install files to other locations, I am forever banned from the
>setuptools world? ;-) Please say it is not true...;-)
What you must not do is install files outside the --install-dir of the
distutils install_data or install_lib commands, which is rude even in the
distutils-only world. In other words, do not use absolute paths in your
setup() data_files. If you need to have a different default --install-dir
for these commands, you should put that information in your project's
setup.cfg.
When building an egg, your defaults will then be ignored (because bdist_egg
explicitly sets its own directories), but when your project is installed in
backward-compatibility mode (i.e., not as a .egg file but as a direct
install or system package), the data will go where you want it.
More information about the Distutils-SIG
mailing list