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 venv,pyenv,direnv #763

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
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
Loading