diff --git a/mu/virtual_environment.py b/mu/virtual_environment.py index 0c6087fc6..5e393e955 100644 --- a/mu/virtual_environment.py +++ b/mu/virtual_environment.py @@ -291,9 +291,18 @@ def run( params.extend(args) if slots.output is None: - result = self.process.run_blocking( - self.executable, params, wait_for_s=wait_for_s - ) + if command == "install": + venv_path = os.path.dirname(os.path.dirname(self.executable)) + exe = self.executable.replace("pip", "uv") + params.remove("--disable-pip-version-check") + result = self.process.run_blocking( + exe, ["pip"] + params, wait_for_s=wait_for_s, + VIRTUAL_ENV=venv_path + ) + else: + result = self.process.run_blocking( + self.executable, params, wait_for_s=wait_for_s + ) logger.debug("Process output: %s", compact(result.strip())) return result else: @@ -886,6 +895,15 @@ def create_venv(self): ), ) ok, output = self.run_subprocess(*args, env=env) + args = filter( + None, + ( + os.path.join(self.path, "bin", "pip"), + "install", + "uv", + ), + ) + ok, output = self.run_subprocess(*args, env=env) if ok: logger.info( "Created virtual environment using %s at %s", @@ -951,6 +969,7 @@ def install_from_zipped_wheels(self, zipped_wheels_filepath): os.path.basename(wheel) ) ) + wheel = f"{os.path.basename(wheel).split('-')[0]}@{wheel}" self.pip.install(wheel, deps=False, index=False) def install_baseline_packages(self):