From 3ae521974f2d5913585ecb6ffc90990f9fb9aa43 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Thu, 19 Apr 2018 20:01:26 +0200 Subject: [PATCH] enable source installs for build dependencies --- docs/reference/pip.rst | 5 +++-- news/5229.feature | 1 + src/pip/_internal/build_env.py | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 news/5229.feature diff --git a/docs/reference/pip.rst b/docs/reference/pip.rst index dd68f65ad..905be1ea6 100644 --- a/docs/reference/pip.rst +++ b/docs/reference/pip.rst @@ -154,8 +154,9 @@ appropriately. installation of build dependencies from source has been disabled until a safe resolution of this issue is found. -* ``pip<18.0`` does not support the use of environment markers and extras, only - version specifiers are respected. +* ``pip<18.0``: only support installing build requirements from wheels, and + does not support the use of environment markers and extras (only version + specifiers are respected). Future Developments diff --git a/news/5229.feature b/news/5229.feature new file mode 100644 index 000000000..8df75ad16 --- /dev/null +++ b/news/5229.feature @@ -0,0 +1 @@ +Add support for installing PEP 518 build dependencies from source. diff --git a/src/pip/_internal/build_env.py b/src/pip/_internal/build_env.py index 612b46352..875ad3f84 100644 --- a/src/pip/_internal/build_env.py +++ b/src/pip/_internal/build_env.py @@ -80,10 +80,13 @@ class BuildEnvironment(object): args = [ sys.executable, '-m', 'pip', 'install', '--ignore-installed', '--no-user', '--prefix', self.path, '--no-warn-script-location', - '--only-binary', ':all:', ] if logger.getEffectiveLevel() <= logging.DEBUG: args.append('-v') + for format_control in ('no_binary', 'only_binary'): + formats = getattr(finder.format_control, format_control) + args.extend(('--' + format_control.replace('_', '-'), + ','.join(sorted(formats or {':none:'})))) if finder.index_urls: args.extend(['-i', finder.index_urls[0]]) for extra_index in finder.index_urls[1:]: