@@ -673,7 +673,7 @@ def _tmpdir(self):
673673 finally :
674674 os .path .exists (tmpdir ) and _rmtree (tmpdir )
675675
676- def easy_install (self , spec , deps : bool = False ):
676+ def easy_install (self , spec , deps : bool = False ) -> Distribution | None :
677677 with self ._tmpdir () as tmpdir :
678678 if not isinstance (spec , Requirement ):
679679 if URL_SCHEME (spec ):
@@ -710,7 +710,9 @@ def easy_install(self, spec, deps: bool = False):
710710 else :
711711 return self .install_item (spec , dist .location , tmpdir , deps )
712712
713- def install_item (self , spec , download , tmpdir , deps , install_needed : bool = False ):
713+ def install_item (
714+ self , spec , download , tmpdir , deps , install_needed : bool = False
715+ ) -> Distribution | None :
714716 # Installation is also needed if file in tmpdir or is not an egg
715717 install_needed = install_needed or bool (self .always_copy )
716718 install_needed = install_needed or os .path .dirname (download ) == tmpdir
@@ -881,7 +883,7 @@ def write_script(self, script_name, contents, mode: str = "t", blockers=()) -> N
881883 f .write (contents )
882884 chmod (target , 0o777 - mask )
883885
884- def install_eggs (self , spec , dist_filename , tmpdir ):
886+ def install_eggs (self , spec , dist_filename , tmpdir ) -> list [ Distribution ] :
885887 # .egg dirs or files are already built, so just return them
886888 installer_map = {
887889 '.egg' : self .install_egg ,
@@ -1142,7 +1144,7 @@ def install_wheel(self, wheel_path, tmpdir):
11421144 """
11431145 )
11441146
1145- def installation_report (self , req , dist , what : str = "Installed" ):
1147+ def installation_report (self , req , dist , what : str = "Installed" ) -> str :
11461148 """Helpful installation message for display to package users"""
11471149 msg = "\n %(what)s %(eggloc)s%(extras)s"
11481150 if self .multi_version and not self .no_report :
@@ -2079,7 +2081,7 @@ def from_environment(cls):
20792081 return cls ([cls ._sys_executable ()])
20802082
20812083 @classmethod
2082- def from_string (cls , string : str ):
2084+ def from_string (cls , string : str ) -> Self :
20832085 """
20842086 Construct a command spec from a simple string representing a command
20852087 line parseable by shlex.split.
@@ -2221,7 +2223,7 @@ def get_header(
22212223 cls ,
22222224 script_text : str = "" ,
22232225 executable : str | CommandSpec | Iterable [str ] | None = None ,
2224- ):
2226+ ) -> str :
22252227 """Create a #! line, getting options (if any) from script_text"""
22262228 cmd = cls .command_spec_class .best ().from_param (executable )
22272229 cmd .install_options (script_text )
0 commit comments