Skip to content

Commit

Permalink
Add venv,pyenv,direnv (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
araa47 authored Jul 10, 2024
1 parent a828d12 commit 115c5aa
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ voxometadata/secrets
# Env vars
.env

.python-version
.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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

Read this article: https://cloud.google.com/blog/products/data-analytics/ethereum-bigquery-how-we-built-dataset

## Local Development Prerequisites

- direnv
- pyenv


We are using direnv to automatically set up and load the correct python version. We also create a venv in the root folder,
that is automatically activated when entering the project folder.

## Setting up Airflow DAGs using Google Cloud Composer

### Create BigQuery Datasets
Expand Down

0 comments on commit 115c5aa

Please sign in to comment.