mirror of https://github.com/pypa/pip
Merge pull request #8752 from sbidoul/imp-8369-deprecation-sbi
This commit is contained in:
parent
b98dd2d07d
commit
d8f0a7b693
|
@ -0,0 +1,3 @@
|
||||||
|
Make the ``setup.py install`` deprecation warning less noisy. We warn only
|
||||||
|
when ``setup.py install`` succeeded and ``setup.py bdist_wheel`` failed, as
|
||||||
|
situations where both fails are most probably irrelevant to this deprecation.
|
|
@ -22,7 +22,6 @@ from pip._internal.operations.check import check_install_conflicts
|
||||||
from pip._internal.req import install_given_reqs
|
from pip._internal.req import install_given_reqs
|
||||||
from pip._internal.req.req_tracker import get_requirement_tracker
|
from pip._internal.req.req_tracker import get_requirement_tracker
|
||||||
from pip._internal.utils.datetime import today_is_later_than
|
from pip._internal.utils.datetime import today_is_later_than
|
||||||
from pip._internal.utils.deprecation import deprecated
|
|
||||||
from pip._internal.utils.distutils_args import parse_distutils_args
|
from pip._internal.utils.distutils_args import parse_distutils_args
|
||||||
from pip._internal.utils.filesystem import test_writable_dir
|
from pip._internal.utils.filesystem import test_writable_dir
|
||||||
from pip._internal.utils.misc import (
|
from pip._internal.utils.misc import (
|
||||||
|
@ -372,23 +371,9 @@ class InstallCommand(RequirementCommand):
|
||||||
# For now, we just warn about failures building legacy
|
# For now, we just warn about failures building legacy
|
||||||
# requirements, as we'll fall through to a direct
|
# requirements, as we'll fall through to a direct
|
||||||
# install for those.
|
# install for those.
|
||||||
legacy_build_failure_names = [
|
for r in build_failures:
|
||||||
r.name # type: ignore
|
if not r.use_pep517:
|
||||||
for r in build_failures if not r.use_pep517
|
r.legacy_install_reason = 8368
|
||||||
] # type: List[str]
|
|
||||||
if legacy_build_failure_names:
|
|
||||||
deprecated(
|
|
||||||
reason=(
|
|
||||||
"Could not build wheels for {} which do not use "
|
|
||||||
"PEP 517. pip will fall back to legacy 'setup.py "
|
|
||||||
"install' for these.".format(
|
|
||||||
", ".join(legacy_build_failure_names)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
replacement="to fix the wheel build issue reported above",
|
|
||||||
gone_in="21.0",
|
|
||||||
issue=8368,
|
|
||||||
)
|
|
||||||
|
|
||||||
to_install = resolver.get_installation_order(
|
to_install = resolver.get_installation_order(
|
||||||
requirement_set
|
requirement_set
|
||||||
|
|
|
@ -121,6 +121,7 @@ class InstallRequirement(object):
|
||||||
self.comes_from = comes_from
|
self.comes_from = comes_from
|
||||||
self.constraint = constraint
|
self.constraint = constraint
|
||||||
self.editable = editable
|
self.editable = editable
|
||||||
|
self.legacy_install_reason = None # type: Optional[int]
|
||||||
|
|
||||||
# source_dir is the local directory where the linked requirement is
|
# source_dir is the local directory where the linked requirement is
|
||||||
# located, or unpacked. In case unpacking is needed, creating and
|
# located, or unpacked. In case unpacking is needed, creating and
|
||||||
|
@ -859,6 +860,18 @@ class InstallRequirement(object):
|
||||||
|
|
||||||
self.install_succeeded = success
|
self.install_succeeded = success
|
||||||
|
|
||||||
|
if success and self.legacy_install_reason == 8368:
|
||||||
|
deprecated(
|
||||||
|
reason=(
|
||||||
|
"{} was installed using the legacy 'setup.py install' "
|
||||||
|
"method, because a wheel could not be built for it.".
|
||||||
|
format(self.name)
|
||||||
|
),
|
||||||
|
replacement="to fix the wheel build issue reported above",
|
||||||
|
gone_in="21.0",
|
||||||
|
issue=8368,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def check_invalid_constraint_type(req):
|
def check_invalid_constraint_type(req):
|
||||||
# type: (InstallRequirement) -> str
|
# type: (InstallRequirement) -> str
|
||||||
|
|
Loading…
Reference in New Issue