@@ -425,7 +425,7 @@ def expand_dirs(self):
425425 ]
426426 self ._expand_attrs (dirs )
427427
428- def run (self , show_deprecation : bool = True ):
428+ def run (self , show_deprecation : bool = True ) -> None :
429429 if show_deprecation :
430430 self .announce (
431431 "WARNING: The easy_install command is deprecated "
@@ -674,7 +674,7 @@ def _tmpdir(self):
674674 finally :
675675 os .path .exists (tmpdir ) and _rmtree (tmpdir )
676676
677- def easy_install (self , spec , deps : bool = False ):
677+ def easy_install (self , spec , deps : bool = False ) -> Distribution | None :
678678 with self ._tmpdir () as tmpdir :
679679 if not isinstance (spec , Requirement ):
680680 if URL_SCHEME (spec ):
@@ -711,7 +711,9 @@ def easy_install(self, spec, deps: bool = False):
711711 else :
712712 return self .install_item (spec , dist .location , tmpdir , deps )
713713
714- def install_item (self , spec , download , tmpdir , deps , install_needed : bool = False ):
714+ def install_item (
715+ self , spec , download , tmpdir , deps , install_needed : bool = False
716+ ) -> Distribution | None :
715717 # Installation is also needed if file in tmpdir or is not an egg
716718 install_needed = install_needed or bool (self .always_copy )
717719 install_needed = install_needed or os .path .dirname (download ) == tmpdir
@@ -761,7 +763,7 @@ def process_distribution( # noqa: C901
761763 dist ,
762764 deps : bool = True ,
763765 * info ,
764- ):
766+ ) -> None :
765767 self .update_pth (dist )
766768 self .package_index .add (dist )
767769 if dist in self .local_index [dist .key ]:
@@ -860,7 +862,7 @@ def _load_template(dev_path):
860862 raw_bytes = resource_string ('setuptools' , name )
861863 return raw_bytes .decode ('utf-8' )
862864
863- def write_script (self , script_name , contents , mode : str = "t" , blockers = ()):
865+ def write_script (self , script_name , contents , mode : str = "t" , blockers = ()) -> None :
864866 """Write an executable file to the scripts directory"""
865867 self .delete_blockers ( # clean up old .py/.pyw w/o a script
866868 [os .path .join (self .script_dir , x ) for x in blockers ]
@@ -882,7 +884,7 @@ def write_script(self, script_name, contents, mode: str = "t", blockers=()):
882884 f .write (contents )
883885 chmod (target , 0o777 - mask )
884886
885- def install_eggs (self , spec , dist_filename , tmpdir ):
887+ def install_eggs (self , spec , dist_filename , tmpdir ) -> list [ Distribution ] :
886888 # .egg dirs or files are already built, so just return them
887889 installer_map = {
888890 '.egg' : self .install_egg ,
@@ -1143,7 +1145,7 @@ def install_wheel(self, wheel_path, tmpdir):
11431145 """
11441146 )
11451147
1146- def installation_report (self , req , dist , what : str = "Installed" ):
1148+ def installation_report (self , req , dist , what : str = "Installed" ) -> str :
11471149 """Helpful installation message for display to package users"""
11481150 msg = "\n %(what)s %(eggloc)s%(extras)s"
11491151 if self .multi_version and not self .no_report :
@@ -2080,7 +2082,7 @@ def from_environment(cls):
20802082 return cls ([cls ._sys_executable ()])
20812083
20822084 @classmethod
2083- def from_string (cls , string : str ):
2085+ def from_string (cls , string : str ) -> Self :
20842086 """
20852087 Construct a command spec from a simple string representing a command
20862088 line parseable by shlex.split.
@@ -2222,7 +2224,7 @@ def get_header(
22222224 cls ,
22232225 script_text : str = "" ,
22242226 executable : str | CommandSpec | Iterable [str ] | None = None ,
2225- ):
2227+ ) -> str :
22262228 """Create a #! line, getting options (if any) from script_text"""
22272229 cmd = cls .command_spec_class .best ().from_param (executable )
22282230 cmd .install_options (script_text )
0 commit comments