From c59a2badd250b6c1e163eafe5bdb881cfe0a97c7 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Fri, 28 Feb 2025 23:08:27 +0900 Subject: [PATCH] auto install uv --- modules/uv_hook.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/uv_hook.py b/modules/uv_hook.py index 4f1392f4a..f9360012d 100644 --- a/modules/uv_hook.py +++ b/modules/uv_hook.py @@ -1,3 +1,4 @@ +import sys import shlex import subprocess from functools import wraps @@ -8,6 +9,11 @@ def patch(): return print("using uv") + try: + subprocess.run(['uv', '-V']) + except FileNotFoundError: + subprocess.run([sys.executable, '-m', 'pip', 'install', 'uv']) + subprocess.__original_run = subprocess.run @wraps(subprocess.__original_run)