mirror of https://github.com/pypa/pip
Fix PEP 517 builds for packages without setup.py (#6606)
This commit is contained in:
parent
4bc72977fc
commit
6ee768a1d4
|
@ -0,0 +1 @@
|
|||
Fix bug that prevented installation of PEP 517 packages without ``setup.py``.
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# The following comment should be removed at some point in the future.
|
||||
# It's included for now because without it InstallCommand.run() has a
|
||||
# couple errors where we have to know req.name is str rather than
|
||||
|
@ -102,6 +101,8 @@ def get_check_binary_allowed(format_control):
|
|||
# type: (FormatControl) -> BinaryAllowedPredicate
|
||||
def check_binary_allowed(req):
|
||||
# type: (InstallRequirement) -> bool
|
||||
if req.use_pep517:
|
||||
return True
|
||||
canonical_name = canonicalize_name(req.name)
|
||||
allowed_formats = format_control.get_allowed_formats(canonical_name)
|
||||
return "binary" in allowed_formats
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[build-system]
|
||||
requires = [ "setuptools" ]
|
||||
build-backend = "setuptools.build_meta"
|
|
@ -0,0 +1,3 @@
|
|||
[metadata]
|
||||
name = pep517-setup-and-pyproject
|
||||
version = 1.0
|
|
@ -0,0 +1,3 @@
|
|||
from setuptools import setup
|
||||
|
||||
setup()
|
|
@ -1274,6 +1274,19 @@ def test_install_no_binary_disables_building_wheels(script, data, with_wheel):
|
|||
assert "Running setup.py install for upper" in str(res), str(res)
|
||||
|
||||
|
||||
def test_install_no_binary_builds_pep_517_wheel(script, data, with_wheel):
|
||||
to_install = data.packages.joinpath('pep517_setup_and_pyproject')
|
||||
res = script.pip(
|
||||
'install', '--no-binary=:all:', '-f', data.find_links, to_install
|
||||
)
|
||||
expected = ("Successfully installed pep517-setup-and-pyproject")
|
||||
# Must have installed the package
|
||||
assert expected in str(res), str(res)
|
||||
|
||||
assert "Building wheel for pep517-setup" in str(res), str(res)
|
||||
assert "Running setup.py install for pep517-set" not in str(res), str(res)
|
||||
|
||||
|
||||
def test_install_no_binary_disables_cached_wheels(script, data, with_wheel):
|
||||
# Seed the cache
|
||||
script.pip(
|
||||
|
|
Loading…
Reference in New Issue