@@ -205,7 +205,6 @@ def initialize_options(self):
205205 # always come from the standard configuration file(s)' "easy_install"
206206 # section, even if this is a "develop" or "install" command, or some
207207 # other embedding.
208- self ._dry_run = None
209208 self .verbose = self .distribution .verbose
210209 self .distribution ._set_command_options (
211210 self , self .distribution .get_option_dict ('easy_install' )
@@ -221,8 +220,6 @@ def delete_blockers(self, blockers) -> None:
221220
222221 def _delete_path (self , path ):
223222 log .info ("Deleting %s" , path )
224- if self .dry_run :
225- return
226223
227224 is_tree = os .path .isdir (path ) and not os .path .islink (path )
228225 remover = _rmtree if is_tree else os .unlink
@@ -868,9 +865,6 @@ def write_script(self, script_name, contents, mode: str = "t", blockers=()) -> N
868865 target = os .path .join (self .script_dir , script_name )
869866 self .add_output (target )
870867
871- if self .dry_run :
872- return
873-
874868 mask = current_umask ()
875869 ensure_directory (target )
876870 if os .path .exists (target ):
@@ -945,15 +939,14 @@ def install_egg(self, egg_path, tmpdir):
945939 os .path .basename (egg_path ),
946940 )
947941 destination = os .path .abspath (destination )
948- if not self .dry_run :
949- ensure_directory (destination )
942+ ensure_directory (destination )
950943
951944 dist = self .egg_distribution (egg_path )
952945 if not (
953946 os .path .exists (destination ) and os .path .samefile (egg_path , destination )
954947 ):
955948 if os .path .isdir (destination ) and not os .path .islink (destination ):
956- dir_util .remove_tree (destination , dry_run = self . dry_run )
949+ dir_util .remove_tree (destination )
957950 elif os .path .exists (destination ):
958951 self .execute (
959952 os .unlink ,
@@ -1036,7 +1029,6 @@ def install_exe(self, dist_filename, tmpdir):
10361029 egg_path ,
10371030 egg_tmp ,
10381031 verbose = self .verbose ,
1039- dry_run = self .dry_run ,
10401032 )
10411033 # install the .egg
10421034 return self .install_egg (egg_path , tmpdir )
@@ -1099,10 +1091,9 @@ def install_wheel(self, wheel_path, tmpdir):
10991091 assert wheel .is_compatible ()
11001092 destination = os .path .join (self .install_dir , wheel .egg_name ())
11011093 destination = os .path .abspath (destination )
1102- if not self .dry_run :
1103- ensure_directory (destination )
1094+ ensure_directory (destination )
11041095 if os .path .isdir (destination ) and not os .path .islink (destination ):
1105- dir_util .remove_tree (destination , dry_run = self . dry_run )
1096+ dir_util .remove_tree (destination )
11061097 elif os .path .exists (destination ):
11071098 self .execute (
11081099 os .unlink ,
@@ -1185,8 +1176,6 @@ def run_setup(self, setup_script, setup_base, args) -> None:
11851176 args .insert (0 , '-' + v )
11861177 elif self .verbose < 2 :
11871178 args .insert (0 , '-q' )
1188- if self .dry_run :
1189- args .insert (0 , '-n' )
11901179 log .info ("Running %s %s" , setup_script [len (setup_base ) + 1 :], ' ' .join (args ))
11911180 try :
11921181 run_setup (setup_script , args )
@@ -1210,7 +1199,7 @@ def build_and_install(self, setup_script, setup_base):
12101199 for key in all_eggs
12111200 for dist in all_eggs [key ]
12121201 ]
1213- if not eggs and not self . dry_run :
1202+ if not eggs :
12141203 log .warn ("No eggs found in %s (setup script problem?)" , dist_dir )
12151204 return eggs
12161205 finally :
@@ -1244,7 +1233,7 @@ def _set_fetcher_options(self, base):
12441233 cfg_filename = os .path .join (base , 'setup.cfg' )
12451234 setopt .edit_config (cfg_filename , settings )
12461235
1247- def update_pth (self , dist ) -> None : # noqa: C901 # is too complex (11) # FIXME
1236+ def update_pth (self , dist ) -> None :
12481237 if self .pth_file is None :
12491238 return
12501239
@@ -1269,9 +1258,6 @@ def update_pth(self, dist) -> None: # noqa: C901 # is too complex (11) # FIXM
12691258 if dist .location not in self .shadow_path :
12701259 self .shadow_path .append (dist .location )
12711260
1272- if self .dry_run :
1273- return
1274-
12751261 self .pth_file .save ()
12761262
12771263 if dist .key != 'setuptools' :
@@ -1303,14 +1289,13 @@ def pf(src, dst):
13031289 elif dst .endswith ('.dll' ) or dst .endswith ('.so' ):
13041290 to_chmod .append (dst )
13051291 self .unpack_progress (src , dst )
1306- return not self . dry_run and dst or None
1292+ return dst or None
13071293
13081294 unpack_archive (egg_path , destination , pf )
13091295 self .byte_compile (to_compile )
1310- if not self .dry_run :
1311- for f in to_chmod :
1312- mode = ((os .stat (f )[stat .ST_MODE ]) | 0o555 ) & 0o7755
1313- chmod (f , mode )
1296+ for f in to_chmod :
1297+ mode = ((os .stat (f )[stat .ST_MODE ]) | 0o555 ) & 0o7755
1298+ chmod (f , mode )
13141299
13151300 def byte_compile (self , to_compile ) -> None :
13161301 if sys .dont_write_bytecode :
@@ -1322,13 +1307,12 @@ def byte_compile(self, to_compile) -> None:
13221307 # try to make the byte compile messages quieter
13231308 log .set_verbosity (self .verbose - 1 )
13241309
1325- byte_compile (to_compile , optimize = 0 , force = True , dry_run = self . dry_run )
1310+ byte_compile (to_compile , optimize = 0 , force = True )
13261311 if self .optimize :
13271312 byte_compile (
13281313 to_compile ,
13291314 optimize = self .optimize ,
13301315 force = True ,
1331- dry_run = self .dry_run ,
13321316 )
13331317 finally :
13341318 log .set_verbosity (self .verbose ) # restore original verbosity
0 commit comments