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

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


On Saturday, December 07, 2013 06:19:42 PM Nick Coghlan wrote:
> In the binary dependency management threads, Daniel pointed out that
> in all currently defined sysconfig schemes, the "data" directory will
> end up pointing to the target installation directory. The "data" name
> in the scheme doesn't actually mean "this is a data file", it means
> "this has no defined semantic meaning at the sysconfig level, so just
> put it exactly where the relative path says to put it".
> 
> 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).

No need for --root. What people use (those that have to get work done instead of discussing 
semantics and stuff :) ) is this:

data_files = [
	('sbin/', [ ... ]),
     ('/etc', [....]),
     ('/var/lib', [...]),
     # I have seen this too
     ('../etc', [....])

That naturally (sometimes) breaks installation into prefixes != /usr.

They do it because python packaging tools leave them alone on anything this is not script and 
package . it does not even have a way to install into the correct /usr/share/... (and windows 
equivalent).

And i have seen people setting the install_data dir in setup.cfg to something like 
share/<myproject> if they only needed to install something there. To shorten their paths in 
setup.py.

Setuptools needs fhs support. Done in a platform compatible way.

Mike

-- 
Michael Jansen
http://michael-jansen.biz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20131207/f813f8aa/attachment-0001.html>


More information about the Distutils-SIG mailing list