:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(flox): set UV_PROJECT_ENVIRONMENT in profile, not [vars] (#64927)
Tom Piccirellof27aee3fd225
diff --git a/.flox/env/manifest.toml b/.flox/env/manifest.tomlindex 89b9b3b59790..670b58cde806 100644--- a/.flox/env/manifest.toml+++ b/.flox/env/manifest.toml@@ -75,8 +75,9 @@ DOTENV_FILE = ".env"OPENSSL_INCLUDE_DIR = "$FLOX_ENV/include"LDFLAGS="-L$FLOX_ENV/lib"CPPFLAGS="-I$FLOX_ENV/include"-UV_PROJECT_ENVIRONMENT = "$FLOX_ENV_CACHE/venv"RUSTC_WRAPPER = "sccache"+# UV_PROJECT_ENVIRONMENT is set in the [hook]/[profile] scripts, not here: [vars]+# are added without expanding $FLOX_ENV_CACHE, so flox drops it on fresh activation.# The `hook.on-activate` script is run by the *bash* shell immediately upon# activating an environment, and will not be invoked if Flox detects that the@@ -107,6 +108,8 @@ bash = '''export GOMODCACHE="$GOPATH/pkg/mod"# Ensure flox binaries (especially Node.js) take precedence over system binariesexport PATH="$FLOX_ENV/bin:$PATH"+ # uv venv path — set here, not in [vars] (which can't expand $FLOX_ENV_CACHE)+ export UV_PROJECT_ENVIRONMENT="$FLOX_ENV_CACHE/venv"# Recreate venv if it was deleted (on-activate only runs on first activation)if [ ! -f "$UV_PROJECT_ENVIRONMENT/bin/activate" ]; thenuv sync@@ -135,6 +138,8 @@ zsh = '''export GOMODCACHE="$GOPATH/pkg/mod"# Ensure flox binaries (especially Node.js) take precedence over system binariesexport PATH="$FLOX_ENV/bin:$PATH"+ # uv venv path — set here, not in [vars] (which can't expand $FLOX_ENV_CACHE)+ export UV_PROJECT_ENVIRONMENT="$FLOX_ENV_CACHE/venv"# Recreate venv if it was deleted (on-activate only runs on first activation)if [[ ! -f "$UV_PROJECT_ENVIRONMENT/bin/activate" ]]; thenuv sync@@ -159,6 +164,8 @@ fish = '''set -gx GOMODCACHE "$GOPATH/pkg/mod"# Ensure flox binaries (especially Node.js) take precedence over system binariesfish_add_path -g "$FLOX_ENV/bin"+ # uv venv path — set here, not in [vars] (which can't expand $FLOX_ENV_CACHE)+ set -gx UV_PROJECT_ENVIRONMENT "$FLOX_ENV_CACHE/venv"# Recreate venv if it was deleted (on-activate only runs on first activation)if not test -f "$UV_PROJECT_ENVIRONMENT/bin/activate.fish"uv sync@@ -176,6 +183,8 @@ tcsh = '''setenv GOMODCACHE "$GOPATH/pkg/mod"# Ensure flox binaries (especially Node.js) take precedence over system binariessetenv PATH "$FLOX_ENV/bin:$PATH"+ # uv venv path — set here, not in [vars] (which can't expand $FLOX_ENV_CACHE)+ setenv UV_PROJECT_ENVIRONMENT "$FLOX_ENV_CACHE/venv"# Recreate venv if it was deleted (on-activate only runs on first activation)if ( ! -f "$UV_PROJECT_ENVIRONMENT/bin/activate.csh" ) thenuv syncdiff --git a/.flox/env/on-activate.sh b/.flox/env/on-activate.shindex ae72f6f06852..929610b3d471 100755--- a/.flox/env/on-activate.sh+++ b/.flox/env/on-activate.sh@@ -220,6 +220,10 @@ export GOPATH="$FLOX_ENV_CACHE/go"export GOCACHE="$FLOX_ENV_CACHE/go-build"export GOMODCACHE="$GOPATH/pkg/mod"+# uv-managed venv location (mirrors the [profile] scripts; not in [vars], which+# can't expand $FLOX_ENV_CACHE). Used below for uv sync + the hogli symlink.+export UV_PROJECT_ENVIRONMENT="$FLOX_ENV_CACHE/venv"+# ── Direnv first-time setup (interactive only) ─────────────────────if [[ "$_interactive" == true ]] && ! command -v direnv >/dev/null 2>&1 && [[ ! -f "$FLOX_ENV_CACHE/.hush-direnv" ]]; thenread -p "$(echo -e "${C_BOLD}direnv${C_RESET} recommended for auto-activation. Set up now? (Y/n) ")" -n 1 -r