Skip to content

Commit 46e247f

Browse files
committed
PEP 517 build in presence of --global-option emits a warning
So these are not ignored silently.
1 parent 8aaca95 commit 46e247f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/pip/_internal/wheel_builder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ def _build_one_inside_env(
244244
if req.use_pep517:
245245
assert req.metadata_directory
246246
assert req.pep517_backend
247+
if global_options:
248+
logger.warning(
249+
'Ignoring --global-option when building %s using PEP 517', req.name
250+
)
247251
if build_options:
248252
logger.warning(
249253
'Ignoring --build-option when building %s using PEP 517', req.name

tests/functional/test_pep517.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,17 @@ def test_pep517_and_build_options(script, tmpdir, data, common_wheels):
266266
)
267267
assert 'Ignoring --build-option when building' in result.stderr
268268
assert 'using PEP 517' in result.stderr
269+
270+
271+
@pytest.mark.network
272+
def test_pep517_and_global_options(script, tmpdir, data, common_wheels):
273+
"""Backend generated requirements are installed in the build env"""
274+
project_dir, name = make_pyproject_with_setup(tmpdir)
275+
result = script.pip(
276+
'wheel', '--wheel-dir', tmpdir,
277+
'--global-option', 'foo',
278+
'-f', common_wheels,
279+
project_dir,
280+
)
281+
assert 'Ignoring --global-option when building' in result.stderr
282+
assert 'using PEP 517' in result.stderr

0 commit comments

Comments
 (0)