Mercurial > public > mercurial-scm > hg
comparison contrib/automation/hgautomation/cli.py @ 43076:2372284d9457
formatting: blacken the codebase
This is using my patch to black
(https://github.com/psf/black/pull/826) so we don't un-wrap collection
literals.
Done with:
hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S
# skip-blame mass-reformatting only
# no-check-commit reformats foo_bar functions
Differential Revision: https://phab.mercurial-scm.org/D6971
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 06 Oct 2019 09:45:02 -0400 |
parents | c5c502bd1f70 |
children | 9d441f820c8b |
comparison
equal
deleted
inserted
replaced
43075:57875cf423c9 | 43076:2372284d9457 |
---|---|
20 try_server, | 20 try_server, |
21 windows, | 21 windows, |
22 ) | 22 ) |
23 | 23 |
24 | 24 |
25 SOURCE_ROOT = pathlib.Path(os.path.abspath(__file__)).parent.parent.parent.parent | 25 SOURCE_ROOT = pathlib.Path( |
26 os.path.abspath(__file__) | |
27 ).parent.parent.parent.parent | |
26 DIST_PATH = SOURCE_ROOT / 'dist' | 28 DIST_PATH = SOURCE_ROOT / 'dist' |
27 | 29 |
28 | 30 |
29 def bootstrap_linux_dev(hga: HGAutomation, aws_region, distros=None, | 31 def bootstrap_linux_dev( |
30 parallel=False): | 32 hga: HGAutomation, aws_region, distros=None, parallel=False |
33 ): | |
31 c = hga.aws_connection(aws_region) | 34 c = hga.aws_connection(aws_region) |
32 | 35 |
33 if distros: | 36 if distros: |
34 distros = distros.split(',') | 37 distros = distros.split(',') |
35 else: | 38 else: |
57 c = hga.aws_connection(aws_region) | 60 c = hga.aws_connection(aws_region) |
58 image = aws.ensure_windows_dev_ami(c, base_image_name=base_image_name) | 61 image = aws.ensure_windows_dev_ami(c, base_image_name=base_image_name) |
59 print('Windows development AMI available as %s' % image.id) | 62 print('Windows development AMI available as %s' % image.id) |
60 | 63 |
61 | 64 |
62 def build_inno(hga: HGAutomation, aws_region, arch, revision, version, | 65 def build_inno( |
63 base_image_name): | 66 hga: HGAutomation, aws_region, arch, revision, version, base_image_name |
67 ): | |
64 c = hga.aws_connection(aws_region) | 68 c = hga.aws_connection(aws_region) |
65 image = aws.ensure_windows_dev_ami(c, base_image_name=base_image_name) | 69 image = aws.ensure_windows_dev_ami(c, base_image_name=base_image_name) |
66 DIST_PATH.mkdir(exist_ok=True) | 70 DIST_PATH.mkdir(exist_ok=True) |
67 | 71 |
68 with aws.temporary_windows_dev_instances(c, image, 't3.medium') as insts: | 72 with aws.temporary_windows_dev_instances(c, image, 't3.medium') as insts: |
69 instance = insts[0] | 73 instance = insts[0] |
70 | 74 |
71 windows.synchronize_hg(SOURCE_ROOT, revision, instance) | 75 windows.synchronize_hg(SOURCE_ROOT, revision, instance) |
72 | 76 |
73 for a in arch: | 77 for a in arch: |
74 windows.build_inno_installer(instance.winrm_client, a, | 78 windows.build_inno_installer( |
75 DIST_PATH, | 79 instance.winrm_client, a, DIST_PATH, version=version |
76 version=version) | 80 ) |
77 | 81 |
78 | 82 |
79 def build_wix(hga: HGAutomation, aws_region, arch, revision, version, | 83 def build_wix( |
80 base_image_name): | 84 hga: HGAutomation, aws_region, arch, revision, version, base_image_name |
85 ): | |
81 c = hga.aws_connection(aws_region) | 86 c = hga.aws_connection(aws_region) |
82 image = aws.ensure_windows_dev_ami(c, base_image_name=base_image_name) | 87 image = aws.ensure_windows_dev_ami(c, base_image_name=base_image_name) |
83 DIST_PATH.mkdir(exist_ok=True) | 88 DIST_PATH.mkdir(exist_ok=True) |
84 | 89 |
85 with aws.temporary_windows_dev_instances(c, image, 't3.medium') as insts: | 90 with aws.temporary_windows_dev_instances(c, image, 't3.medium') as insts: |
86 instance = insts[0] | 91 instance = insts[0] |
87 | 92 |
88 windows.synchronize_hg(SOURCE_ROOT, revision, instance) | 93 windows.synchronize_hg(SOURCE_ROOT, revision, instance) |
89 | 94 |
90 for a in arch: | 95 for a in arch: |
91 windows.build_wix_installer(instance.winrm_client, a, | 96 windows.build_wix_installer( |
92 DIST_PATH, version=version) | 97 instance.winrm_client, a, DIST_PATH, version=version |
93 | 98 ) |
94 | 99 |
95 def build_windows_wheel(hga: HGAutomation, aws_region, arch, revision, | 100 |
96 base_image_name): | 101 def build_windows_wheel( |
102 hga: HGAutomation, aws_region, arch, revision, base_image_name | |
103 ): | |
97 c = hga.aws_connection(aws_region) | 104 c = hga.aws_connection(aws_region) |
98 image = aws.ensure_windows_dev_ami(c, base_image_name=base_image_name) | 105 image = aws.ensure_windows_dev_ami(c, base_image_name=base_image_name) |
99 DIST_PATH.mkdir(exist_ok=True) | 106 DIST_PATH.mkdir(exist_ok=True) |
100 | 107 |
101 with aws.temporary_windows_dev_instances(c, image, 't3.medium') as insts: | 108 with aws.temporary_windows_dev_instances(c, image, 't3.medium') as insts: |
105 | 112 |
106 for a in arch: | 113 for a in arch: |
107 windows.build_wheel(instance.winrm_client, a, DIST_PATH) | 114 windows.build_wheel(instance.winrm_client, a, DIST_PATH) |
108 | 115 |
109 | 116 |
110 def build_all_windows_packages(hga: HGAutomation, aws_region, revision, | 117 def build_all_windows_packages( |
111 version, base_image_name): | 118 hga: HGAutomation, aws_region, revision, version, base_image_name |
119 ): | |
112 c = hga.aws_connection(aws_region) | 120 c = hga.aws_connection(aws_region) |
113 image = aws.ensure_windows_dev_ami(c, base_image_name=base_image_name) | 121 image = aws.ensure_windows_dev_ami(c, base_image_name=base_image_name) |
114 DIST_PATH.mkdir(exist_ok=True) | 122 DIST_PATH.mkdir(exist_ok=True) |
115 | 123 |
116 with aws.temporary_windows_dev_instances(c, image, 't3.medium') as insts: | 124 with aws.temporary_windows_dev_instances(c, image, 't3.medium') as insts: |
122 | 130 |
123 for arch in ('x86', 'x64'): | 131 for arch in ('x86', 'x64'): |
124 windows.purge_hg(winrm_client) | 132 windows.purge_hg(winrm_client) |
125 windows.build_wheel(winrm_client, arch, DIST_PATH) | 133 windows.build_wheel(winrm_client, arch, DIST_PATH) |
126 windows.purge_hg(winrm_client) | 134 windows.purge_hg(winrm_client) |
127 windows.build_inno_installer(winrm_client, arch, DIST_PATH, | 135 windows.build_inno_installer( |
128 version=version) | 136 winrm_client, arch, DIST_PATH, version=version |
137 ) | |
129 windows.purge_hg(winrm_client) | 138 windows.purge_hg(winrm_client) |
130 windows.build_wix_installer(winrm_client, arch, DIST_PATH, | 139 windows.build_wix_installer( |
131 version=version) | 140 winrm_client, arch, DIST_PATH, version=version |
141 ) | |
132 | 142 |
133 | 143 |
134 def terminate_ec2_instances(hga: HGAutomation, aws_region): | 144 def terminate_ec2_instances(hga: HGAutomation, aws_region): |
135 c = hga.aws_connection(aws_region, ensure_ec2_state=False) | 145 c = hga.aws_connection(aws_region, ensure_ec2_state=False) |
136 aws.terminate_ec2_instances(c.ec2resource) | 146 aws.terminate_ec2_instances(c.ec2resource) |
139 def purge_ec2_resources(hga: HGAutomation, aws_region): | 149 def purge_ec2_resources(hga: HGAutomation, aws_region): |
140 c = hga.aws_connection(aws_region, ensure_ec2_state=False) | 150 c = hga.aws_connection(aws_region, ensure_ec2_state=False) |
141 aws.remove_resources(c) | 151 aws.remove_resources(c) |
142 | 152 |
143 | 153 |
144 def run_tests_linux(hga: HGAutomation, aws_region, instance_type, | 154 def run_tests_linux( |
145 python_version, test_flags, distro, filesystem): | 155 hga: HGAutomation, |
156 aws_region, | |
157 instance_type, | |
158 python_version, | |
159 test_flags, | |
160 distro, | |
161 filesystem, | |
162 ): | |
146 c = hga.aws_connection(aws_region) | 163 c = hga.aws_connection(aws_region) |
147 image = aws.ensure_linux_dev_ami(c, distro=distro) | 164 image = aws.ensure_linux_dev_ami(c, distro=distro) |
148 | 165 |
149 t_start = time.time() | 166 t_start = time.time() |
150 | 167 |
151 ensure_extra_volume = filesystem not in ('default', 'tmpfs') | 168 ensure_extra_volume = filesystem not in ('default', 'tmpfs') |
152 | 169 |
153 with aws.temporary_linux_dev_instances( | 170 with aws.temporary_linux_dev_instances( |
154 c, image, instance_type, | 171 c, image, instance_type, ensure_extra_volume=ensure_extra_volume |
155 ensure_extra_volume=ensure_extra_volume) as insts: | 172 ) as insts: |
156 | 173 |
157 instance = insts[0] | 174 instance = insts[0] |
158 | 175 |
159 linux.prepare_exec_environment(instance.ssh_client, | 176 linux.prepare_exec_environment( |
160 filesystem=filesystem) | 177 instance.ssh_client, filesystem=filesystem |
178 ) | |
161 linux.synchronize_hg(SOURCE_ROOT, instance, '.') | 179 linux.synchronize_hg(SOURCE_ROOT, instance, '.') |
162 t_prepared = time.time() | 180 t_prepared = time.time() |
163 linux.run_tests(instance.ssh_client, python_version, | 181 linux.run_tests(instance.ssh_client, python_version, test_flags) |
164 test_flags) | |
165 t_done = time.time() | 182 t_done = time.time() |
166 | 183 |
167 t_setup = t_prepared - t_start | 184 t_setup = t_prepared - t_start |
168 t_all = t_done - t_start | 185 t_all = t_done - t_start |
169 | 186 |
170 print( | 187 print( |
171 'total time: %.1fs; setup: %.1fs; tests: %.1fs; setup overhead: %.1f%%' | 188 'total time: %.1fs; setup: %.1fs; tests: %.1fs; setup overhead: %.1f%%' |
172 % (t_all, t_setup, t_done - t_prepared, t_setup / t_all * 100.0)) | 189 % (t_all, t_setup, t_done - t_prepared, t_setup / t_all * 100.0) |
173 | 190 ) |
174 | 191 |
175 def run_tests_windows(hga: HGAutomation, aws_region, instance_type, | 192 |
176 python_version, arch, test_flags, base_image_name): | 193 def run_tests_windows( |
177 c = hga.aws_connection(aws_region) | 194 hga: HGAutomation, |
178 image = aws.ensure_windows_dev_ami(c, base_image_name=base_image_name) | 195 aws_region, |
179 | 196 instance_type, |
180 with aws.temporary_windows_dev_instances(c, image, instance_type, | 197 python_version, |
181 disable_antivirus=True) as insts: | 198 arch, |
199 test_flags, | |
200 base_image_name, | |
201 ): | |
202 c = hga.aws_connection(aws_region) | |
203 image = aws.ensure_windows_dev_ami(c, base_image_name=base_image_name) | |
204 | |
205 with aws.temporary_windows_dev_instances( | |
206 c, image, instance_type, disable_antivirus=True | |
207 ) as insts: | |
182 instance = insts[0] | 208 instance = insts[0] |
183 | 209 |
184 windows.synchronize_hg(SOURCE_ROOT, '.', instance) | 210 windows.synchronize_hg(SOURCE_ROOT, '.', instance) |
185 windows.run_tests(instance.winrm_client, python_version, arch, | 211 windows.run_tests( |
186 test_flags) | 212 instance.winrm_client, python_version, arch, test_flags |
187 | 213 ) |
188 | 214 |
189 def publish_windows_artifacts(hg: HGAutomation, aws_region, version: str, | 215 |
190 pypi: bool, mercurial_scm_org: bool, | 216 def publish_windows_artifacts( |
191 ssh_username: str): | 217 hg: HGAutomation, |
192 windows.publish_artifacts(DIST_PATH, version, | 218 aws_region, |
193 pypi=pypi, mercurial_scm_org=mercurial_scm_org, | 219 version: str, |
194 ssh_username=ssh_username) | 220 pypi: bool, |
221 mercurial_scm_org: bool, | |
222 ssh_username: str, | |
223 ): | |
224 windows.publish_artifacts( | |
225 DIST_PATH, | |
226 version, | |
227 pypi=pypi, | |
228 mercurial_scm_org=mercurial_scm_org, | |
229 ssh_username=ssh_username, | |
230 ) | |
195 | 231 |
196 | 232 |
197 def run_try(hga: HGAutomation, aws_region: str, rev: str): | 233 def run_try(hga: HGAutomation, aws_region: str, rev: str): |
198 c = hga.aws_connection(aws_region, ensure_ec2_state=False) | 234 c = hga.aws_connection(aws_region, ensure_ec2_state=False) |
199 try_server.trigger_try(c, rev=rev) | 235 try_server.trigger_try(c, rev=rev) |
206 '--state-path', | 242 '--state-path', |
207 default='~/.hgautomation', | 243 default='~/.hgautomation', |
208 help='Path for local state files', | 244 help='Path for local state files', |
209 ) | 245 ) |
210 parser.add_argument( | 246 parser.add_argument( |
211 '--aws-region', | 247 '--aws-region', help='AWS region to use', default='us-west-2', |
212 help='AWS region to use', | |
213 default='us-west-2', | |
214 ) | 248 ) |
215 | 249 |
216 subparsers = parser.add_subparsers() | 250 subparsers = parser.add_subparsers() |
217 | 251 |
218 sp = subparsers.add_parser( | 252 sp = subparsers.add_parser( |
219 'bootstrap-linux-dev', | 253 'bootstrap-linux-dev', help='Bootstrap Linux development environments', |
220 help='Bootstrap Linux development environments', | 254 ) |
221 ) | 255 sp.add_argument( |
222 sp.add_argument( | 256 '--distros', help='Comma delimited list of distros to bootstrap', |
223 '--distros', | |
224 help='Comma delimited list of distros to bootstrap', | |
225 ) | 257 ) |
226 sp.add_argument( | 258 sp.add_argument( |
227 '--parallel', | 259 '--parallel', |
228 action='store_true', | 260 action='store_true', |
229 help='Generate AMIs in parallel (not CTRL-c safe)' | 261 help='Generate AMIs in parallel (not CTRL-c safe)', |
230 ) | 262 ) |
231 sp.set_defaults(func=bootstrap_linux_dev) | 263 sp.set_defaults(func=bootstrap_linux_dev) |
232 | 264 |
233 sp = subparsers.add_parser( | 265 sp = subparsers.add_parser( |
234 'bootstrap-windows-dev', | 266 'bootstrap-windows-dev', |
240 default=aws.WINDOWS_BASE_IMAGE_NAME, | 272 default=aws.WINDOWS_BASE_IMAGE_NAME, |
241 ) | 273 ) |
242 sp.set_defaults(func=bootstrap_windows_dev) | 274 sp.set_defaults(func=bootstrap_windows_dev) |
243 | 275 |
244 sp = subparsers.add_parser( | 276 sp = subparsers.add_parser( |
245 'build-all-windows-packages', | 277 'build-all-windows-packages', help='Build all Windows packages', |
246 help='Build all Windows packages', | 278 ) |
247 ) | 279 sp.add_argument( |
248 sp.add_argument( | 280 '--revision', help='Mercurial revision to build', default='.', |
249 '--revision', | 281 ) |
250 help='Mercurial revision to build', | 282 sp.add_argument( |
251 default='.', | 283 '--version', help='Mercurial version string to use', |
252 ) | |
253 sp.add_argument( | |
254 '--version', | |
255 help='Mercurial version string to use', | |
256 ) | 284 ) |
257 sp.add_argument( | 285 sp.add_argument( |
258 '--base-image-name', | 286 '--base-image-name', |
259 help='AMI name of base image', | 287 help='AMI name of base image', |
260 default=aws.WINDOWS_BASE_IMAGE_NAME, | 288 default=aws.WINDOWS_BASE_IMAGE_NAME, |
261 ) | 289 ) |
262 sp.set_defaults(func=build_all_windows_packages) | 290 sp.set_defaults(func=build_all_windows_packages) |
263 | 291 |
264 sp = subparsers.add_parser( | 292 sp = subparsers.add_parser( |
265 'build-inno', | 293 'build-inno', help='Build Inno Setup installer(s)', |
266 help='Build Inno Setup installer(s)', | |
267 ) | 294 ) |
268 sp.add_argument( | 295 sp.add_argument( |
269 '--arch', | 296 '--arch', |
270 help='Architecture to build for', | 297 help='Architecture to build for', |
271 choices={'x86', 'x64'}, | 298 choices={'x86', 'x64'}, |
272 nargs='*', | 299 nargs='*', |
273 default=['x64'], | 300 default=['x64'], |
274 ) | 301 ) |
275 sp.add_argument( | 302 sp.add_argument( |
276 '--revision', | 303 '--revision', help='Mercurial revision to build', default='.', |
277 help='Mercurial revision to build', | 304 ) |
278 default='.', | 305 sp.add_argument( |
279 ) | 306 '--version', help='Mercurial version string to use in installer', |
280 sp.add_argument( | |
281 '--version', | |
282 help='Mercurial version string to use in installer', | |
283 ) | 307 ) |
284 sp.add_argument( | 308 sp.add_argument( |
285 '--base-image-name', | 309 '--base-image-name', |
286 help='AMI name of base image', | 310 help='AMI name of base image', |
287 default=aws.WINDOWS_BASE_IMAGE_NAME, | 311 default=aws.WINDOWS_BASE_IMAGE_NAME, |
288 ) | 312 ) |
289 sp.set_defaults(func=build_inno) | 313 sp.set_defaults(func=build_inno) |
290 | 314 |
291 sp = subparsers.add_parser( | 315 sp = subparsers.add_parser( |
292 'build-windows-wheel', | 316 'build-windows-wheel', help='Build Windows wheel(s)', |
293 help='Build Windows wheel(s)', | |
294 ) | 317 ) |
295 sp.add_argument( | 318 sp.add_argument( |
296 '--arch', | 319 '--arch', |
297 help='Architecture to build for', | 320 help='Architecture to build for', |
298 choices={'x86', 'x64'}, | 321 choices={'x86', 'x64'}, |
299 nargs='*', | 322 nargs='*', |
300 default=['x64'], | 323 default=['x64'], |
301 ) | 324 ) |
302 sp.add_argument( | 325 sp.add_argument( |
303 '--revision', | 326 '--revision', help='Mercurial revision to build', default='.', |
304 help='Mercurial revision to build', | |
305 default='.', | |
306 ) | 327 ) |
307 sp.add_argument( | 328 sp.add_argument( |
308 '--base-image-name', | 329 '--base-image-name', |
309 help='AMI name of base image', | 330 help='AMI name of base image', |
310 default=aws.WINDOWS_BASE_IMAGE_NAME, | 331 default=aws.WINDOWS_BASE_IMAGE_NAME, |
311 ) | 332 ) |
312 sp.set_defaults(func=build_windows_wheel) | 333 sp.set_defaults(func=build_windows_wheel) |
313 | 334 |
314 sp = subparsers.add_parser( | 335 sp = subparsers.add_parser('build-wix', help='Build WiX installer(s)') |
315 'build-wix', | |
316 help='Build WiX installer(s)' | |
317 ) | |
318 sp.add_argument( | 336 sp.add_argument( |
319 '--arch', | 337 '--arch', |
320 help='Architecture to build for', | 338 help='Architecture to build for', |
321 choices={'x86', 'x64'}, | 339 choices={'x86', 'x64'}, |
322 nargs='*', | 340 nargs='*', |
323 default=['x64'], | 341 default=['x64'], |
324 ) | 342 ) |
325 sp.add_argument( | 343 sp.add_argument( |
326 '--revision', | 344 '--revision', help='Mercurial revision to build', default='.', |
327 help='Mercurial revision to build', | 345 ) |
328 default='.', | 346 sp.add_argument( |
329 ) | 347 '--version', help='Mercurial version string to use in installer', |
330 sp.add_argument( | |
331 '--version', | |
332 help='Mercurial version string to use in installer', | |
333 ) | 348 ) |
334 sp.add_argument( | 349 sp.add_argument( |
335 '--base-image-name', | 350 '--base-image-name', |
336 help='AMI name of base image', | 351 help='AMI name of base image', |
337 default=aws.WINDOWS_BASE_IMAGE_NAME, | 352 default=aws.WINDOWS_BASE_IMAGE_NAME, |
343 help='Terminate all active EC2 instances managed by us', | 358 help='Terminate all active EC2 instances managed by us', |
344 ) | 359 ) |
345 sp.set_defaults(func=terminate_ec2_instances) | 360 sp.set_defaults(func=terminate_ec2_instances) |
346 | 361 |
347 sp = subparsers.add_parser( | 362 sp = subparsers.add_parser( |
348 'purge-ec2-resources', | 363 'purge-ec2-resources', help='Purge all EC2 resources managed by us', |
349 help='Purge all EC2 resources managed by us', | |
350 ) | 364 ) |
351 sp.set_defaults(func=purge_ec2_resources) | 365 sp.set_defaults(func=purge_ec2_resources) |
352 | 366 |
353 sp = subparsers.add_parser( | 367 sp = subparsers.add_parser('run-tests-linux', help='Run tests on Linux',) |
354 'run-tests-linux', | |
355 help='Run tests on Linux', | |
356 ) | |
357 sp.add_argument( | 368 sp.add_argument( |
358 '--distro', | 369 '--distro', |
359 help='Linux distribution to run tests on', | 370 help='Linux distribution to run tests on', |
360 choices=linux.DISTROS, | 371 choices=linux.DISTROS, |
361 default='debian10', | 372 default='debian10', |
372 default='c5.9xlarge', | 383 default='c5.9xlarge', |
373 ) | 384 ) |
374 sp.add_argument( | 385 sp.add_argument( |
375 '--python-version', | 386 '--python-version', |
376 help='Python version to use', | 387 help='Python version to use', |
377 choices={'system2', 'system3', '2.7', '3.5', '3.6', '3.7', '3.8', | 388 choices={ |
378 'pypy', 'pypy3.5', 'pypy3.6'}, | 389 'system2', |
390 'system3', | |
391 '2.7', | |
392 '3.5', | |
393 '3.6', | |
394 '3.7', | |
395 '3.8', | |
396 'pypy', | |
397 'pypy3.5', | |
398 'pypy3.6', | |
399 }, | |
379 default='system2', | 400 default='system2', |
380 ) | 401 ) |
381 sp.add_argument( | 402 sp.add_argument( |
382 'test_flags', | 403 'test_flags', |
383 help='Extra command line flags to pass to run-tests.py', | 404 help='Extra command line flags to pass to run-tests.py', |
384 nargs='*', | 405 nargs='*', |
385 ) | 406 ) |
386 sp.set_defaults(func=run_tests_linux) | 407 sp.set_defaults(func=run_tests_linux) |
387 | 408 |
388 sp = subparsers.add_parser( | 409 sp = subparsers.add_parser( |
389 'run-tests-windows', | 410 'run-tests-windows', help='Run tests on Windows', |
390 help='Run tests on Windows', | 411 ) |
391 ) | 412 sp.add_argument( |
392 sp.add_argument( | 413 '--instance-type', help='EC2 instance type to use', default='t3.medium', |
393 '--instance-type', | |
394 help='EC2 instance type to use', | |
395 default='t3.medium', | |
396 ) | 414 ) |
397 sp.add_argument( | 415 sp.add_argument( |
398 '--python-version', | 416 '--python-version', |
399 help='Python version to use', | 417 help='Python version to use', |
400 choices={'2.7', '3.5', '3.6', '3.7', '3.8'}, | 418 choices={'2.7', '3.5', '3.6', '3.7', '3.8'}, |
405 help='Architecture to test', | 423 help='Architecture to test', |
406 choices={'x86', 'x64'}, | 424 choices={'x86', 'x64'}, |
407 default='x64', | 425 default='x64', |
408 ) | 426 ) |
409 sp.add_argument( | 427 sp.add_argument( |
410 '--test-flags', | 428 '--test-flags', help='Extra command line flags to pass to run-tests.py', |
411 help='Extra command line flags to pass to run-tests.py', | |
412 ) | 429 ) |
413 sp.add_argument( | 430 sp.add_argument( |
414 '--base-image-name', | 431 '--base-image-name', |
415 help='AMI name of base image', | 432 help='AMI name of base image', |
416 default=aws.WINDOWS_BASE_IMAGE_NAME, | 433 default=aws.WINDOWS_BASE_IMAGE_NAME, |
417 ) | 434 ) |
418 sp.set_defaults(func=run_tests_windows) | 435 sp.set_defaults(func=run_tests_windows) |
419 | 436 |
420 sp = subparsers.add_parser( | 437 sp = subparsers.add_parser( |
421 'publish-windows-artifacts', | 438 'publish-windows-artifacts', |
422 help='Publish built Windows artifacts (wheels, installers, etc)' | 439 help='Publish built Windows artifacts (wheels, installers, etc)', |
423 ) | 440 ) |
424 sp.add_argument( | 441 sp.add_argument( |
425 '--no-pypi', | 442 '--no-pypi', |
426 dest='pypi', | 443 dest='pypi', |
427 action='store_false', | 444 action='store_false', |
434 action='store_false', | 451 action='store_false', |
435 default=True, | 452 default=True, |
436 help='Skip uploading to www.mercurial-scm.org', | 453 help='Skip uploading to www.mercurial-scm.org', |
437 ) | 454 ) |
438 sp.add_argument( | 455 sp.add_argument( |
439 '--ssh-username', | 456 '--ssh-username', help='SSH username for mercurial-scm.org', |
440 help='SSH username for mercurial-scm.org', | 457 ) |
441 ) | 458 sp.add_argument( |
442 sp.add_argument( | 459 'version', help='Mercurial version string to locate local packages', |
443 'version', | |
444 help='Mercurial version string to locate local packages', | |
445 ) | 460 ) |
446 sp.set_defaults(func=publish_windows_artifacts) | 461 sp.set_defaults(func=publish_windows_artifacts) |
447 | 462 |
448 sp = subparsers.add_parser( | 463 sp = subparsers.add_parser( |
449 'try', | 464 'try', help='Run CI automation against a custom changeset' |
450 help='Run CI automation against a custom changeset' | 465 ) |
451 ) | 466 sp.add_argument('-r', '--rev', default='.', help='Revision to run CI on') |
452 sp.add_argument('-r', '--rev', | |
453 default='.', | |
454 help='Revision to run CI on') | |
455 sp.set_defaults(func=run_try) | 467 sp.set_defaults(func=run_try) |
456 | 468 |
457 return parser | 469 return parser |
458 | 470 |
459 | 471 |