From 06cb48bdc98f30c95febdff69bc6fab0f0823783 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Sun, 15 Apr 2018 16:29:49 +0200 Subject: [PATCH] fix PEP 518 support: support markers in build requirements --- news/5230.bugfix | 1 + src/pip/_internal/operations/prepare.py | 10 +++++----- tests/data/packages/pep518-3.0.tar.gz | Bin 853 -> 899 bytes tests/data/src/pep518-3.0/pyproject.toml | 6 +++++- 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 news/5230.bugfix diff --git a/news/5230.bugfix b/news/5230.bugfix new file mode 100644 index 00000000000..be8c58b4637 --- /dev/null +++ b/news/5230.bugfix @@ -0,0 +1 @@ +Fix PEP 518 support: support markers in build requirements. diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py index 7d1297ea00b..4427d70fc53 100644 --- a/src/pip/_internal/operations/prepare.py +++ b/src/pip/_internal/operations/prepare.py @@ -53,11 +53,11 @@ def _install_build_reqs(finder, prefix, build_requirements): # that should handle all the isolation and sub-process invocation. finder = copy(finder) finder.format_control = FormatControl(set(), set([":all:"])) - urls = [ - finder.find_requirement( - InstallRequirement.from_line(r), upgrade=False).url - for r in build_requirements - ] + urls = [] + for req_str in build_requirements: + req = InstallRequirement.from_line(req_str) + if req.match_markers(): + urls.append(finder.find_requirement(req, upgrade=False).url) args = [ sys.executable, '-m', 'pip', 'install', '--ignore-installed', '--no-user', '--prefix', prefix, diff --git a/tests/data/packages/pep518-3.0.tar.gz b/tests/data/packages/pep518-3.0.tar.gz index f912e6d85a2e689bb46f266d6571fbbf8714a36a..d687e4cee2a1fd8c88b08df28273804d63ff84c4 100644 GIT binary patch literal 899 zcmV-}1AP1+iwFpcWYby#|72-%bT4paa5XVFEi*1KE_7jX0PULJPunmM$NM_}6&^ek zB$7HwlT2)#gcxjyQP60_DeGqd{!yl4N3`QCbq3T-8)oCJU+XloTkE-6! zyayt?a@z;UdXlF~Kg(E8gaVJhMb)_%g=&z}4$7uv}NCS_L|83u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