On Fri, 14 Sep 2018 at 14:51, sashk <b...@sashk.xyz> wrote: > No, I'm not installing anything into standard unix locations. My package is > for internal use, so we had a luxury to write it specifically for use with > virtual environment. > > We need to install Jupyter kernels (and other files) into > $VIRTUAL_ENV/etc/jupyter and $VIRTUAL_ENV/share/jupyter paths. This was done > with the help of data_files, and works unless we build wheel, because of use > of absolute paths. > > Do I understand correctly, that when using relative paths in the data_files > and installing package into virtual environment, installation prefix is > sys.prefix and it is the same as $VIRTUAL_ENV?
My understanding (and I'm not an expert here, so hopefully someone else will confirm or correct) is that yes, the data directory is installed to "the installation root", which is $VIRTUAL_ENV for a virtualenv, and "something else" for non-virtualenvs (I think it's / on Unix and sys.prefix on Windows, no idea what happens for user installs). See https://github.com/pypa/pip/blob/master/src/pip/_internal/locations.py#L136 for what pip does, but basically it defers to whatever distutils/setuptools considers to be the `install_data` location. This also sounds like the sort of requirement that came up in the discussion around Daniel's proposal for more install locations, from https://mail.python.org/pipermail/distutils-sig/2015-April/026222.html, so maybe it's another motivating case for that proposal (although the discussion in that thread petered out, so someone will need to pick it up again if there's interest). Paul -- Distutils-SIG mailing list -- distutils-sig@python.org To unsubscribe send an email to distutils-sig-le...@python.org https://mail.python.org/mm3/mailman3/lists/distutils-sig.python.org/ Message archived at https://mail.python.org/mm3/archives/list/distutils-sig@python.org/message/ADD7U6CAFHZOHBSBDQMBUJXEHWQGMNIW/