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

Paul Moore p.f.moore at gmail.com
Sat Dec 7 23:22:44 CET 2013


On 7 December 2013 21:32, Marcus Smith <qwcode at gmail.com> wrote:
> actually, bdist_wheel doesn't handle absolute paths in the "data_files"
> keyword like standard setuptools installs do, which honor it as absolute
> (which seems to match the examples in the distutils docs)
> when using absolute paths, the data ends up in the packaged wheel at the top
> level (not in the {distribution}-{version}.data folder).
> And get's installed relative to site-packages (along with the project
> packages)
>
> so, bdist_wheel is re-interpreting distutil's "data_files" differently.
> maybe better for wheel to fail to build projects with absolute data_files,
> than to just reinterpret it like that.

+1. It seems to me (from a Windows user's perspective) that projects
that use absolute paths (or relative paths that go above the
installation root) are fundamentally different from ones that don't.
For a start they feel more like "applications" than "Python packages".

Maybe what we want is a sysconfig path "root" that explicitly encodes
the filesystem root. Then we can require that *all* paths are relative
to some sysconfig path, and must not use ".." to go "up" from there.
Projects that use the "root" path can be clearly noted as not
wheel-compatible (and quite likely not cross-platform).

By making it an explicit path, we can make the policy explicit and
provide better error messages and metadata.

Paul

PS Please note that as a Windows user, I don't have any practical
experience of projects with requirements for absolue paths - they are
alien to the Windows world. So my views should be taken in that light
(i.e, as being of limited value :-)).


More information about the Distutils-SIG mailing list