@@ -424,7 +424,7 @@ def expand_dirs(self):
424424 ]
425425 self ._expand_attrs (dirs )
426426
427- def run (self , show_deprecation : bool = True ):
427+ def run (self , show_deprecation : bool = True ) -> None :
428428 if show_deprecation :
429429 self .announce (
430430 "WARNING: The easy_install command is deprecated "
@@ -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
@@ -760,7 +762,7 @@ def process_distribution( # noqa: C901
760762 dist ,
761763 deps : bool = True ,
762764 * info ,
763- ):
765+ ) -> None :
764766 self .update_pth (dist )
765767 self .package_index .add (dist )
766768 if dist in self .local_index [dist .key ]:
@@ -859,7 +861,7 @@ def _load_template(dev_path):
859861 raw_bytes = resource_string ('setuptools' , name )
860862 return raw_bytes .decode ('utf-8' )
861863
862- def write_script (self , script_name , contents , mode : str = "t" , blockers = ()):
864+ def write_script (self , script_name , contents , mode : str = "t" , blockers = ()) -> None :
863865 """Write an executable file to the scripts directory"""
864866 self .delete_blockers ( # clean up old .py/.pyw w/o a script
865867 [os .path .join (self .script_dir , x ) for x in blockers ]
@@ -881,7 +883,7 @@ def write_script(self, script_name, contents, mode: str = "t", blockers=()):
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