mirror of https://github.com/pypa/pip
Reject --build-options for PEP 517 builds
This commit is contained in:
parent
62cfaf0fc7
commit
9921442d1f
|
@ -910,6 +910,11 @@ class WheelBuilder(object):
|
|||
Returns path to wheel if successfully built. Otherwise, returns None.
|
||||
"""
|
||||
assert req.metadata_directory is not None
|
||||
if self.build_options:
|
||||
# PEP 517 does not support --build-options
|
||||
logger.error('Cannot build wheel for %s using PEP 517 when '
|
||||
'--build-options is present' % (req.name,))
|
||||
return None
|
||||
try:
|
||||
req.spin_message = 'Building wheel for %s (PEP 517)' % (req.name,)
|
||||
logger.debug('Destination directory: %s', tempd)
|
||||
|
|
|
@ -198,3 +198,16 @@ def test_explicit_setuptools_backend(script, tmpdir, data, common_wheels):
|
|||
project_dir,
|
||||
)
|
||||
result.assert_installed(name, editable=False)
|
||||
|
||||
def test_pep517_and_build_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
|
||||
'--build-option', 'foo',
|
||||
'-f', common_wheels,
|
||||
project_dir,
|
||||
expect_error=True
|
||||
)
|
||||
assert 'Cannot build wheel' in result.stderr
|
||||
assert 'when --build-options is present' in result.stderr
|
||||
|
|
Loading…
Reference in New Issue