[Distutils] Clarifying the meaning of the sysconfig "data" directory
Nick Coghlan
ncoghlan at gmail.com
Sat Dec 7 09:19:42 CET 2013
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).
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".
So, I think we should fix the docs to reflect the way the schemes are
defined in practice. I'd like to clarify them to say that "data" will
always point to the installation target directory for the software
being installed (on POSIX systems, typically /, /usr, /usr/local,
~/.local or a virtual environment directory), and thus the "data" path
is intended for any file which doesn't fit one of the predefined
categories - they're arbitrary data files from the *packaging
system's* point of view, but not necessarily from the *application's*
point of view.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Distutils-SIG
mailing list