-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add optional UV support for faster local development #11
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,6 +132,33 @@ make reqs-upgrade | |
| > Remember that if you change the [requirements.txt], | ||
| you need to rebuild the docker image (`make docker-build`) in order to use it locally. | ||
|
|
||
| ### Using UV for faster local development (Optional) | ||
|
|
||
| **This is for local development only.** Docker builds use pip by default. | ||
|
|
||
| If you prefer faster dependency resolution and installation during local development, | ||
| you can optionally use [uv](https://docs.astral.sh/uv/) instead of pip. | ||
|
|
||
| Install `uv`: | ||
| ```shell | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| ``` | ||
|
|
||
| Then, use it with the justfile commands: | ||
|
|
||
| ``` | ||
| just install | ||
| ``` | ||
|
|
||
| Or use the Makefile commands while overriding the `PIP` variable: | ||
|
|
||
| ```shell | ||
| make install PIP="uv pip" | ||
| ``` | ||
|
Comment on lines
+153
to
+157
|
||
|
|
||
| This will use `uv pip` for faster resolution while maintaining the same functionality. | ||
| Docker and CI/CD pipelines will continue to use standard pip. | ||
|
|
||
| ## Git Workflow | ||
|
|
||
| <div align="justify"> | ||
|
|
@@ -170,7 +197,7 @@ Try to follow these guidelines: | |
|
|
||
| - Maintain a clean commit history in your feature branch. | ||
| Use interactive rebase (`git rebase -i`) to squash, reorder, or edit commits.[^1] | ||
|
|
||
| - If you are not using [pre-commit] hooks, | ||
| use the provided [Makefile] commands (`format`, `lint`, `codespell`, `typecheck`) | ||
| as much as possible to maintain code quality. | ||
|
|
@@ -195,8 +222,8 @@ Try to follow these guidelines: | |
|
|
||
| <div align="justify"> | ||
|
|
||
| A Google Cloud build that publishes a Docker image is triggered in the following cases: | ||
| - When a commit is merged into `main` or `develop`. | ||
| A Google Cloud build that publishes a Docker image is triggered in the following cases: | ||
| - When a commit is merged into `main` or `develop`. | ||
| - When a new tag is created. | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,97 @@ | ||||||||||||||||||||||
| # Justfile - Thin wrapper for local development | ||||||||||||||||||||||
| # Adjusts PYTHON and PIP variables for venv, then calls Make recipes | ||||||||||||||||||||||
| # Use: `just install`, `just test`, `just reqs`, etc. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| set shell := ["bash", "-c"] | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| VENV_NAME := ".venv" | ||||||||||||||||||||||
| PYTHON := VENV_NAME / "bin" / "python" | ||||||||||||||||||||||
| PIP := "uv pip" | ||||||||||||||||||||||
|
Comment on lines
+8
to
+10
|
||||||||||||||||||||||
| PIP := "uv pip" | |
| PIP := env_var_or_default('PIP', 'python -m pip') |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The venv recipe doesn't pass the PYTHON variable to make, unlike other recipes. While this is currently correct since the Makefile's venv target doesn't accept variables, it creates inconsistency. If UV is intended to be used for virtual environment creation (which UV can do faster), this should be handled differently or documented as a limitation.
| make venv | |
| make venv PYTHON="{{ PYTHON }}" PIP="{{ PIP }}" |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in the comment. Should be "Install pre-commit hooks" instead of "Install and pre-commit hooks".
| # Install and pre-commit hooks | |
| # Install pre-commit hooks |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The justfile passes PYTHON and PIP variables to the reqs make target, but the Makefile's reqs target uses Docker and doesn't accept or use these variables. This creates a misleading interface where users might expect UV to be used for requirements compilation, but Docker with standard pip is always used instead.
| make reqs PYTHON="{{ PYTHON }}" PIP="{{ PIP }}" | |
| # Upgrade requirements.txt with pip-tools | |
| reqs-upgrade: | |
| make reqs-upgrade PYTHON="{{ PYTHON }}" PIP="{{ PIP }}" | |
| make reqs | |
| # Upgrade requirements.txt with pip-tools | |
| reqs-upgrade: | |
| make reqs-upgrade |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation mentions using the justfile but doesn't explain what
justis or how to install it. Users unfamiliar with the just command runner won't know how to use this feature. Consider adding a brief explanation and installation instructions for just (e.g., the command runner tool that executes justfile recipes).