Skip to content

Commit

Permalink
PEP 517 build in presence of --global-option emits a warning
Browse files Browse the repository at this point in the history
So these are not ignored silently.
  • Loading branch information
sbidoul committed Apr 4, 2021
1 parent 8aaca95 commit 46e247f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pip/_internal/wheel_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ def _build_one_inside_env(
if req.use_pep517:
assert req.metadata_directory
assert req.pep517_backend
if global_options:
logger.warning(
'Ignoring --global-option when building %s using PEP 517', req.name
)
if build_options:
logger.warning(
'Ignoring --build-option when building %s using PEP 517', req.name
Expand Down
14 changes: 14 additions & 0 deletions tests/functional/test_pep517.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,17 @@ def test_pep517_and_build_options(script, tmpdir, data, common_wheels):
)
assert 'Ignoring --build-option when building' in result.stderr
assert 'using PEP 517' in result.stderr


@pytest.mark.network
def test_pep517_and_global_options(script, tmpdir, data, common_wheels):
"""Backend generated requirements are installed in the build env"""
project_dir, name = make_pyproject_with_setup(tmpdir)
result = script.pip(
'wheel', '--wheel-dir', tmpdir,
'--global-option', 'foo',
'-f', common_wheels,
project_dir,
)
assert 'Ignoring --global-option when building' in result.stderr
assert 'using PEP 517' in result.stderr

0 comments on commit 46e247f

Please sign in to comment.