From 91c2790e754b307ecfe9bd84db107da2bc85ffb9 Mon Sep 17 00:00:00 2001 From: Sasha Lopoukhine Date: Mon, 16 Dec 2024 15:04:36 +0000 Subject: [PATCH] misc: use activated venv dir if any, and add back project venv export (#3630) This change lets us use the activated venv, if any, for all our make commands. In order to make it work, I had to add back the export, because otherwise the inner uv commands would complain about the fact that the current venv is not the same as the project venv, which is .venv if not overridden. --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f422f3eeb5..5be8b96cb1 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,9 @@ COVERAGE_FILE ?= .coverage # allow overriding the name of the venv directory VENV_DIR ?= .venv -UV_PROJECT_ENVIRONMENT=${VENV_DIR} + +# use activated venv if any +export UV_PROJECT_ENVIRONMENT=$(if $(VIRTUAL_ENV),$(VIRTUAL_ENV),$(VENV_DIR)) # allow overriding which extras are installed VENV_EXTRAS ?= --extra gui --extra dev --extra jax --extra riscv