Switching to uv and direnv.
This commit is contained in:
parent
4777d96c42
commit
888b8ae98f
6 changed files with 96 additions and 34 deletions
29
.envrc
Normal file
29
.envrc
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Check if .venv exists
|
||||
if [[ -d ".venv" ]]; then
|
||||
# Activate the virtual environment
|
||||
export VIRTUAL_ENV="$PWD/.venv"
|
||||
export PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
|
||||
# Verify we're using the right Python
|
||||
if [[ -x "$VIRTUAL_ENV/bin/python" ]]; then
|
||||
export PYTHONPATH="$PWD/src:$PYTHONPATH"
|
||||
echo "Activated virtual environment: $VIRTUAL_ENV"
|
||||
else
|
||||
echo "Warning: Virtual environment Python not found"
|
||||
fi
|
||||
else
|
||||
echo "Warning: No .venv directory found"
|
||||
fi
|
||||
|
||||
# Run uv sync to update packages
|
||||
if command -v uv &> /dev/null; then
|
||||
echo "Running uv sync..."
|
||||
uv sync
|
||||
echo "Packages updated successfully"
|
||||
else
|
||||
echo "Warning: uv not found"
|
||||
fi
|
||||
|
||||
echo "Environment configured with direnv"
|
||||
Loading…
Add table
Add a link
Reference in a new issue