-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: always use uv for dependency management (#265)
Modifies the build tooling to always use `uv pip` instead of `pip` and `uv build` instead of `python -m build`. Additional checks are added to ensure that `uv` exists on the system. If `uv` does not exists, then it is installed via `pip`. If `pip` is not installed, it is installed via `python -m ensurepip`. The `pip` check is required for a virtual environment created by `uv venv` since by default, `uv venv` does not install `pip`. The UV_SYSTEM_PYTHON environment variable is set in CI and Docker to force `uv` to use the system Python environment instead of depending on a virtual environment. See https://docs.astral.sh/uv/configuration/environment/ This reduces the execution time of `make` from 22s to 5s on my machine without a Pip cache. With a hydrated PIp cache, the execution time is reduced from 8s to 4s.
- Loading branch information
Showing
9 changed files
with
37 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ on: | |
push: | ||
tags: | ||
- "v*.*.*" | ||
env: | ||
UV_SYSTEM_PYTHON: true | ||
jobs: | ||
default: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
FROM python:3 | ||
|
||
ENV UV_SYSTEM_PYTHON=true | ||
|
||
RUN apt-get update && apt-get install -y make | ||
|
||
WORKDIR /sdk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ clean: | |
find . -type d -empty -delete | ||
|
||
deps: | ||
$(PIP) install --upgrade pip -r requirements-site.txt | ||
$(UV) pip install --upgrade pip -r requirements-site.txt | ||
$(QUARTO) add --no-prompt posit-dev/[email protected] | ||
$(QUARTO) add --no-prompt machow/quartodoc | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ rsconnect-python | |
ruff | ||
setuptools | ||
setuptools-scm | ||
uv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters