Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add direnv #314

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
set -e

# Ensure pyenv is initialized
if command -v pyenv >/dev/null; then
eval "$(pyenv init -)"
fi
# Set the local Python version
if ! pyenv local $(cat .python-version); then
log_error "Failed to activate pyenv version $(cat .python-version)."
log_error "Please ensure pyenv works and has the required python version:"
log_error "# pyenv install $(cat .python-version) && direnv allow"
exit 1
fi
# Create a virtual environment if it doesn't exist
if [ ! -d ".venv" ]; then
python -m venv .venv
echo "Created virtual environment in .venv"
fi
# Activate the virtual environment
source .venv/bin/activate
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ geckodriver.log
voxometadata/secrets
# Env vars
.env
.venv
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.8.12
Loading