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

use uv in .envrc #26

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
19 changes: 5 additions & 14 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
VIRTUAL_ENV=".venv"

PATH_add tools

# create venv
# HACK: use system python3.12, rather than bazel-provided Python
# bazel run --ui_event_filters=-INFO --noshow_progress --show_result=0 python3
layout python python3.12

# install pip-tools if it's not already installed
if ! python -m piptools > /dev/null 2>&1; then
python -m pip install --quiet pip-tools
fi

# pip-sync
python -m piptools sync --quiet py_requirements_lock.txt
# HACK: use uv-provided Python, rather than bazel-provided Python
# bazel-provided Python is: bazel run --ui_event_filters=-INFO --noshow_progress --show_result=0 python3
uv venv --python 3.12 --quiet
uv pip sync --require-hashes --verify-hashes --strict --quiet py_requirements_lock.txt
source .venv/bin/activate