[Distutils] [RFC] Recentering the static metadata need : PKG-INFO

David Cournapeau david at ar.media.kyoto-u.ac.jp
Tue Oct 20 05:41:52 CEST 2009


Floris Bruynooghe wrote:
>> For example, if there is a /etc/gdm/gdm.conf it is pretty safe
>> to assume that gnome is installed on that system.
>>
>> So in your PEP, your could have code..
>>
>>  if sys.platform == 'linux2':
>>      gnome_installed = os.path.exists('/etc/gdm/gdm.conf')
>>
>> Then exposed that as a variable in your condition:
>>
>> 'if desktop in "gnome|windows"' etc

Agreed, this is too fragile and complicated. Anyone who has done
packaging knows how fragile those things are: some buggy packages do not
remove some files, some corner cases you did not think about are always
coming.

At least for things like platform, arch and os, things are quite stable.
For everything else, either there is a way to define our own variable
whose values are handled by outside code (say setup.py or command line),
or you don't make them available at all in the static file. I don't see
other solution, and the packaging solutions I know do not allow this
kind of things. For any new feature in distutils, it should almost be
mandatory to look at what other people did to the same problem space.
Good design only comes with experience in that space domain, IMO.

David


More information about the Distutils-SIG mailing list