diff --git a/python/mach/mach/util.py b/python/mach/mach/util.py index 3d20135178208..966fd0988ca02 100644 --- a/python/mach/mach/util.py +++ b/python/mach/mach/util.py @@ -703,106 +703,3 @@ return None -def -strtobool -( -value -: -str -) -: - -true_vals -= -( -" -y -" -" -yes -" -" -t -" -" -true -" -" -on -" -" -1 -" -) - -false_vals -= -( -" -n -" -" -no -" -" -f -" -" -false -" -" -off -" -" -0 -" -) - -value -= -value -. -lower -( -) - -if -value -in -true_vals -: - -return -1 - -if -value -in -false_vals -: - -return -0 - -raise -ValueError -( -f -' -Expected -one -of -: -{ -" -" -. -join -( -true_vals -+ -false_vals -) -} -' -) diff --git a/python/mozbuild/mozbuild/backend/mach_commands.py b/python/mozbuild/mozbuild/backend/mach_commands.py index 6e7804386be00..7d62e215db069 100644 --- a/python/mozbuild/mozbuild/backend/mach_commands.py +++ b/python/mozbuild/mozbuild/backend/mach_commands.py @@ -2197,7 +2197,7 @@ " from -mach +distutils . util import diff --git a/python/mozbuild/mozbuild/code_analysis/mach_commands.py b/python/mozbuild/mozbuild/code_analysis/mach_commands.py index 0f3c54564d670..49c780a3a4ffc 100644 --- a/python/mozbuild/mozbuild/code_analysis/mach_commands.py +++ b/python/mozbuild/mozbuild/code_analysis/mach_commands.py @@ -201,7 +201,7 @@ " from -mach +distutils . util import diff --git a/taskcluster/docker/funsize-update-generator/scripts/funsize.py b/taskcluster/docker/funsize-update-generator/scripts/funsize.py index 253f4dff96a74..b388e24e77cc3 100644 --- a/taskcluster/docker/funsize-update-generator/scripts/funsize.py +++ b/taskcluster/docker/funsize-update-generator/scripts/funsize.py @@ -21,18 +21,18 @@ import AsyncExitStack from +distutils +. +util +import +strtobool +from pathlib import Path import aiohttp from -mach -. -util -import -strtobool -from mardor . reader diff --git a/taskcluster/mach_commands.py b/taskcluster/mach_commands.py index 7ed1936efeb71..ae8b3b4231db9 100644 --- a/taskcluster/mach_commands.py +++ b/taskcluster/mach_commands.py @@ -48,12 +48,6 @@ Command CommandArgument SubCommand -from -mach -. -util -import -strtobool logger = logging @@ -65,6 +59,107 @@ " ) def +strtobool +( +value +) +: + +" +" +" +Convert +string +to +boolean +. + +Wraps +" +distutils +. +util +. +strtobool +" +deferring +the +import +of +the +package + +in +case +it +' +s +not +installed +. +Otherwise +we +have +a +" +chicken +and +egg +problem +" +where + +| +mach +bootstrap +| +would +install +the +required +package +to +enable +" +distutils +. +util +" +but + +it +can +' +t +because +mach +fails +to +interpret +this +file +. + +" +" +" + +from +distutils +. +util +import +strtobool + +return +bool +( +strtobool +( +value +) +) +def get_taskgraph_command_parser ( name