[Distutils] Clarifying the meaning of the sysconfig "data" directory

Michael Jansen info at michael-jansen.biz
Sat Dec 7 12:10:38 CET 2013

On Saturday, December 07, 2013 10:26:15 AM Paul Moore wrote:
> On 7 December 2013 08:19, Nick Coghlan <ncoghlan at gmail.com> wrote:
> > That means that you can ship relatively arbitrary software in a wheel
> > file by dumping it in "{distribution}-{version}.data/data/<path>", and
> > then installing it to the appropriate target location (e.g. if you use
> > FHS paths inside the data directory, then you would just need to
> > install the wheel as "pip install --root /" to get things into the
> > desired location).
> > 
> > However, you'd be forgiven for not realising that from the sysconfig
> > docs - I certainly didn't realise it until Daniel pointed it out. From
> > the sysconfig docs, I had expected "data" to mean "application data
> > files" not "arbitrary, potentially executable, file with no assigned
> > semantics".
> The problem with what you're proposing (which isn't a change, as you
> say, so much as a subtle reinterpretation) is that if you include
> something in a wheel under <data>/etc or <data>/usr/include, you *are*
> assigning semantics to it - and the semantics you are assigning is
> POSIX. That's not a disaster, of course, but can make for a less than
> ideal layout on Windows. For example, if packages started putting
> config data under "etc" that would not be normal Windows practice.
> It's not *bad* per se, just disconcerting (and TBH, when I've seen
> this done, it gives the impression of a lazily-ported Unix package).
> Also, this paves the way for people starting to put data files under
> "<data>/usr/share" or whatever the FHS location is. That is definitely
> *not* the Python convention, which is to put the data inside the
> package and locate it via package_data(). It also makes the package
> fail when used zipped or via tools like py2exe.

I guess we agree here. But people already do that because they have no other choice. Nick only 
wants to document the way it works better. Many people already figured this out and use it 

And its very hard to use data_files in a cross platform way. If you want that you are out of luck. 
You can't use it easily. You would have to check the platform and adapt pathes yourself.

See yourself.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20131207/5cd6f57c/attachment.html>

More information about the Distutils-SIG mailing list