20
20
from pip ._vendor .pyproject_hooks import BuildBackendHookCaller
21
21
22
22
from pip ._internal .build_env import BuildEnvironment , NoOpBuildEnvironment
23
- from pip ._internal .exceptions import InstallationError , LegacyInstallFailure
23
+ from pip ._internal .exceptions import InstallationError
24
24
from pip ._internal .locations import get_scheme
25
25
from pip ._internal .metadata import (
26
26
BaseDistribution ,
39
39
from pip ._internal .operations .install .editable_legacy import (
40
40
install_editable as install_editable_legacy ,
41
41
)
42
- from pip ._internal .operations .install .legacy import install as install_legacy
43
42
from pip ._internal .operations .install .wheel import install_wheel
44
43
from pip ._internal .pyproject import load_pyproject_toml , make_pyproject_path
45
44
from pip ._internal .req .req_uninstall import UninstallPathSet
46
- from pip ._internal .utils .deprecation import LegacyInstallReason , deprecated
45
+ from pip ._internal .utils .deprecation import deprecated
47
46
from pip ._internal .utils .hashes import Hashes
48
47
from pip ._internal .utils .misc import (
49
48
ConfiguredBuildBackendHookCaller ,
@@ -93,7 +92,6 @@ def __init__(
93
92
self .constraint = constraint
94
93
self .editable = editable
95
94
self .permit_editable_wheels = permit_editable_wheels
96
- self .legacy_install_reason : Optional [LegacyInstallReason ] = None
97
95
98
96
# source_dir is the local directory where the linked requirement is
99
97
# located, or unpacked. In case unpacking is needed, creating and
@@ -757,10 +755,9 @@ def install(
757
755
prefix = prefix ,
758
756
)
759
757
760
- global_options = global_options if global_options is not None else []
761
758
if self .editable and not self .is_wheel :
762
759
install_editable_legacy (
763
- global_options = global_options ,
760
+ global_options = global_options if global_options is not None else [] ,
764
761
prefix = prefix ,
765
762
home = home ,
766
763
use_user_site = use_user_site ,
@@ -773,66 +770,20 @@ def install(
773
770
self .install_succeeded = True
774
771
return
775
772
776
- if self .is_wheel :
777
- assert self .local_file_path
778
- install_wheel (
779
- self .name ,
780
- self .local_file_path ,
781
- scheme = scheme ,
782
- req_description = str (self .req ),
783
- pycompile = pycompile ,
784
- warn_script_location = warn_script_location ,
785
- direct_url = self .download_info if self .original_link else None ,
786
- requested = self .user_supplied ,
787
- )
788
- self .install_succeeded = True
789
- return
790
-
791
- # TODO: Why don't we do this for editable installs?
792
-
793
- # Extend the list of global options passed on to
794
- # the setup.py call with the ones from the requirements file.
795
- # Options specified in requirements file override those
796
- # specified on the command line, since the last option given
797
- # to setup.py is the one that is used.
798
- global_options = list (global_options ) + self .global_options
799
-
800
- try :
801
- if (
802
- self .legacy_install_reason is not None
803
- and self .legacy_install_reason .emit_before_install
804
- ):
805
- self .legacy_install_reason .emit_deprecation (self .name )
806
- success = install_legacy (
807
- global_options = global_options ,
808
- root = root ,
809
- home = home ,
810
- prefix = prefix ,
811
- use_user_site = use_user_site ,
812
- pycompile = pycompile ,
813
- scheme = scheme ,
814
- setup_py_path = self .setup_py_path ,
815
- isolated = self .isolated ,
816
- req_name = self .name ,
817
- build_env = self .build_env ,
818
- unpacked_source_directory = self .unpacked_source_directory ,
819
- req_description = str (self .req ),
820
- )
821
- except LegacyInstallFailure as exc :
822
- self .install_succeeded = False
823
- raise exc
824
- except Exception :
825
- self .install_succeeded = True
826
- raise
773
+ assert self .is_wheel
774
+ assert self .local_file_path
827
775
828
- self .install_succeeded = success
829
-
830
- if (
831
- success
832
- and self .legacy_install_reason is not None
833
- and self .legacy_install_reason .emit_after_success
834
- ):
835
- self .legacy_install_reason .emit_deprecation (self .name )
776
+ install_wheel (
777
+ self .name ,
778
+ self .local_file_path ,
779
+ scheme = scheme ,
780
+ req_description = str (self .req ),
781
+ pycompile = pycompile ,
782
+ warn_script_location = warn_script_location ,
783
+ direct_url = self .download_info if self .original_link else None ,
784
+ requested = self .user_supplied ,
785
+ )
786
+ self .install_succeeded = True
836
787
837
788
838
789
def check_invalid_constraint_type (req : InstallRequirement ) -> str :
0 commit comments