comparison contrib/automation/hgautomation/windows.py @ 48847:4561ec90d3c1

automation: delete code related to Python 2.7 support The building of Inno and WiX installers took a python_version argument that allowed us to specify "2" or "3" for the major Python version. Since we no longer support Python 2, we can delete this argument and everything feeding into it. Differential Revision: https://phab.mercurial-scm.org/D12264
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 19 Feb 2022 18:42:12 -0700
parents d7e064d509a0
children e4e33b779fa2
comparison
equal deleted inserted replaced
48846:d7e064d509a0 48847:4561ec90d3c1
262 winrm_client.fetch(source, str(dest)) 262 winrm_client.fetch(source, str(dest))
263 263
264 264
265 def build_inno_installer( 265 def build_inno_installer(
266 winrm_client, 266 winrm_client,
267 python_version: int,
268 arch: str, 267 arch: str,
269 dest_path: pathlib.Path, 268 dest_path: pathlib.Path,
270 version=None, 269 version=None,
271 ): 270 ):
272 """Build the Inno Setup installer on a remote machine. 271 """Build the Inno Setup installer on a remote machine.
273 272
274 Using a WinRM client, remote commands are executed to build 273 Using a WinRM client, remote commands are executed to build
275 a Mercurial Inno Setup installer. 274 a Mercurial Inno Setup installer.
276 """ 275 """
277 print( 276 print('building Inno Setup installer for %s' % arch)
278 'building Inno Setup installer for Python %d %s'
279 % (python_version, arch)
280 )
281 277
282 # TODO fix this limitation in packaging code 278 # TODO fix this limitation in packaging code
283 if not version: 279 if not version:
284 raise Exception("version string is required when building for Python 3") 280 raise Exception("version string is required when building for Python 3")
285 281
317 copy_latest_dist(winrm_client, '*.whl', dest_path) 313 copy_latest_dist(winrm_client, '*.whl', dest_path)
318 314
319 315
320 def build_wix_installer( 316 def build_wix_installer(
321 winrm_client, 317 winrm_client,
322 python_version: int,
323 arch: str, 318 arch: str,
324 dest_path: pathlib.Path, 319 dest_path: pathlib.Path,
325 version=None, 320 version=None,
326 ): 321 ):
327 """Build the WiX installer on a remote machine. 322 """Build the WiX installer on a remote machine.
328 323
329 Using a WinRM client, remote commands are executed to build a WiX installer. 324 Using a WinRM client, remote commands are executed to build a WiX installer.
330 """ 325 """
331 print('Building WiX installer for Python %d %s' % (python_version, arch)) 326 print('Building WiX installer for %s' % arch)
332 327
333 # TODO fix this limitation in packaging code 328 # TODO fix this limitation in packaging code
334 if not version: 329 if not version:
335 raise Exception("version string is required when building for Python 3") 330 raise Exception("version string is required when building for Python 3")
336 331