[Python-Dev] PEP 376 - Open questions

M.-A. Lemburg mal at egenix.com
Tue Jul 7 10:57:33 CEST 2009


Paul Moore wrote:
>> I know some people are writing to /etc to add their configuration file
>> on the system,
>>
>> So a real-world example under linux would be:
>>
>> setup(..., data_files=[('/etc', ['myconf.cfg'])], ...)
>>
>>
>> That is basically how the examples are shown at:
>>
>> http://docs.python.org/distutils/setupscript.html#installing-additional-files
> 
> Thanks. Yes, that makes for a good example.
> 
>> But this is already os-specific, and exists because distutils doesn't
>> have a way (yet)
>> to express systems locations independantly from their physical location,
>> like what the RPM system does with %VARIABLES.
>>
>> So another way to handle this maybe, like I have added with $PREFIX
>> and $EXEC_PREFIX would be to nominate a list of variables that every
>> python environment has (querying modules like sys) and let the developers
>> use them as root locations for some files.

I think you have to differentiate between packages and applications.

Packages will usually have their own way of getting configured,
either by passing parameters via some API or pointing the package
to a configuration file. They may come with some example config
files, but should normally don't interfere with the system
configuration. I.e. putting a Python package configuration into /etc
does not really sound like a good idea.

Applications tend to ship everything needed to run the application
together with the installer and typically use a system-dependent
installer rather than a distutils based approach. These then
place config files in the usual default dirs of the system.
This is out-of-scope for PEP 376.

Then you have tools like zc.buildout which basically build
an application in some directory at "install" time. Since only
these tools know what they are doing, the whole "uninstall"
mechanism also lies in their hands. Again, PEP 376 would only
apply to the dynamic package installation part, but not to the
complete application build.

Another aspect to consider is that config files should normally
not be uninstalled automatically. The user should either be asked
whether she wants to keep the files or the uninstaller should leave
them untouched and issue a warning that certain files were not
uninstalled.

Summarizing, I think it's better not to record config files
and other user-edited files in the RECORD file.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jul 07 2009)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Python-Dev mailing list