From 4389570b59cb0f17a982085cafadf2c8ca0a269a Mon Sep 17 00:00:00 2001 From: jwalith4418-Mj <232281058+jwalith4418-Mj@users.noreply.github.com> Date: Mon, 2 Nov 2026 00:52:02 +0530 Subject: [PATCH 1/2] Allow runner help and tests without uv Check parsed arguments before deciding whether uv is required. Avoid launching uv for commands that support running without it, and handle verbose output outside a virtual environment. Prepared with AI assistance; contributor review is required before upload. --- run | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/run b/run index caf60db..73c5cc6 100755 --- a/run +++ b/run @@ -62,9 +62,6 @@ class Runner: sys.exit(1) self.uv_path = shutil.which('uv') - if self.uv_path is None and self.args.command not in ('help', 'tests'): - print('You need to have `uv` installed to run this script') - sys.exit(2) self.venv = None if 'VIRTUAL_ENV' in os.environ: @@ -78,10 +75,14 @@ class Runner: sys.stdout.reconfigure(line_buffering=True) self.parse_args(argv) + if self.uv_path is None and self.args.command not in ('help', 'tests'): + print('You need to have `uv` installed to run this script') + return 2 + if not self.is_supported_python_version(): return 1 - if not self.venv and self.args.command != 'devenv': + if self.uv_path and not self.venv and self.args.command != 'devenv': is_uv = 'UV' in os.environ if not is_uv: run_cmd = ['uv', 'run', '--isolated'] @@ -102,7 +103,11 @@ class Runner: or self.args.command == 'presubmit' ) ): - venv_path = self.venv.replace(THIS_DIR, '/') + venv_path = ( + self.venv.replace(THIS_DIR, '/') + if self.venv + else 'the current environment' + ) if 'cache/uv/builds' in venv_path: venv_path = 'an isolated .venv' print( From 97332c4609d76547a60780370fc57e418c09ad0d Mon Sep 17 00:00:00 2001 From: jwalith4418-Mj <232281058+jwalith4418-Mj@users.noreply.github.com> Date: Mon, 2 Nov 2026 13:17:30 +0530 Subject: [PATCH 2/2] Defer uv discovery until after argument parsing Address the maintainer's review on #156. Prepared with AI assistance. --- run | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run b/run index 73c5cc6..0dbd82f 100755 --- a/run +++ b/run @@ -61,7 +61,7 @@ class Runner: ) sys.exit(1) - self.uv_path = shutil.which('uv') + self.uv_path = None self.venv = None if 'VIRTUAL_ENV' in os.environ: @@ -75,6 +75,7 @@ class Runner: sys.stdout.reconfigure(line_buffering=True) self.parse_args(argv) + self.uv_path = shutil.which('uv') if self.uv_path is None and self.args.command not in ('help', 'tests'): print('You need to have `uv` installed to run this script') return 2