[Distutils] PEP 518 build dependencies reinstalled unconditionally?
Pauli Virtanen
pav at iki.fi
Thu Jun 29 15:26:16 EDT 2017
Hi,
PEP 518 introduces build requirements that pip installs before calling
setup.py.
As it currently appears to be, pip installs them to a temporary
environment used during the build, with "pip install --ignore-installed
...", so that packages given in pyproject.toml are reinstalled
temporarily even if they are already available in the system.
Better behavior could be to reinstall build-requirements only if the
requirement is not already satisfied by system packages.
Pip issue: https://github.com/pypa/pip/issues/4582
Numpy is a common build requirement for several packages providing C
extensions that deal with numpy arrays. The current preinstallation
behavior causes the following problems:
1) Numpy C extension ABI is backward compatible, but not forward
compatible. As a consequence, C extensions built using a newer version
of Numpy than installed on the system may simply segfault. (If there's a
way to mark the version requirement in the built wheel, the end result
is incompatible with the system numpy version.) This can easily happen
if unsuspecting people put 'requires=numpy' to pyproject.toml.
2) It wastes time and resources unnecessarily: numpy rebuild can be 10
min per pop, plus downloading stuff from internet.
--
Pauli Virtanen
More information about the Distutils-SIG
mailing list