Skip to content

Commit f888d3a

Browse files
committed
Automate venv creation and dependency syncing in .envrc
Revised the .envrc script to automatically create a virtual environment and sync dependencies if not present. Enhanced output to display environment and command details dynamically, improving setup automation and user clarity.
1 parent 1ed14dd commit f888d3a

1 file changed

Lines changed: 21 additions & 14 deletions

File tree

.envrc

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,32 @@ watch_file pyproject.toml
66
watch_file flake.nix
77
watch_file uv.lock
88

9-
# Auto-activate venv if it exists, or prompt for setup
109
echo ""
1110
echo "ETH Library Zurich - Data Archive Pipeline (DAP) - Orchestrator"
1211
echo "───────────────────────────────────────────────────────────────"
13-
echo "✓ nix flake activated (python, uv, kubectl, helm, just)"
1412

1513
export DAGSTER_HOME="$PWD"
1614

17-
if [ -d .venv ]; then
18-
source .venv/bin/activate
19-
echo "✓ python venv activated"
20-
echo "✓ DAGSTER_HOME set to $DAGSTER_HOME"
21-
echo ""
22-
echo " just show available commands"
23-
echo " just info show tool versions"
24-
echo " just dev start Dagster dev server"
25-
else
26-
echo "⚠ python venv not found"
27-
echo ""
28-
echo " just setup create venv and install dependencies using uv"
15+
# Auto-create venv and sync dependencies
16+
if [ ! -d .venv ]; then
17+
echo "○ creating venv..."
18+
uv venv --quiet
2919
fi
20+
21+
source .venv/bin/activate
22+
uv sync --extra dev --frozen --quiet
23+
24+
echo ""
25+
echo " Environment"
26+
echo " ─────────────────────────────────────────────────────────────"
27+
echo " nix flake $(nix flake metadata --json 2>/dev/null | jq -r '.resolved.url' | sed 's|^file://||')"
28+
echo " python venv $VIRTUAL_ENV"
29+
echo " python version $(python --version 2>&1 | cut -d' ' -f2)"
30+
echo " DAGSTER_HOME $DAGSTER_HOME"
31+
echo ""
32+
echo " Commands"
33+
echo " ─────────────────────────────────────────────────────────────"
34+
echo " just show available commands"
35+
echo " just info show tool versions"
36+
echo " just dev start Dagster dev server"
3037
echo ""

0 commit comments

Comments
 (0)