This PR switches to using uv for environment and dependency management in our data architecture repo and Actions.
Locally, this (optionally) allows users to:
Use uv for virtual env management (via uv venv && source .venv/bin/activate) with a per-subdirectory virtualenv (i.e. dbt has its own dbt/.venv directory)
Install the pinned Python version (3.11) into the virtualenv using uv python install
Install packages into that virtualenv using uv pip install .
For Actions:
uv now handles caching and installing pip dependencies
The standard, GitHub-provided setup Action uses the pinned Python version in each project
We ignore virtual environments, instead using uv to install directly to the system library (just as we did before with plain pip)
Why make this switch?
uv is significantly faster when installing Python dependencies in Actions (10-100x faster)
It versions and isolates the dependencies used by each subproject (dbt/, socrata/, etc.) via uv.lock files
It pins the Python version used by each subproject and uses the same version within Actions via .python-version files
The downsides are:
It's something new to learn for users. However, the commands are simpler than standard venv and users can still use plain pip and venv if they want to
It's still slightly hacky to install into the system environment within Actions using uv
This PR switches to using
uv
for environment and dependency management in our data architecture repo and Actions.Locally, this (optionally) allows users to:
uv
for virtual env management (viauv venv && source .venv/bin/activate
) with a per-subdirectory virtualenv (i.e. dbt has its owndbt/.venv
directory)uv python install
uv pip install .
For Actions:
uv
now handles caching and installing pip dependenciesuv
to install directly to the system library (just as we did before with plainpip
)Why make this switch?
uv
is significantly faster when installing Python dependencies in Actions (10-100x faster)dbt/
,socrata/
, etc.) viauv.lock
files.python-version
filesThe downsides are:
venv
and users can still use plainpip
andvenv
if they want touv