Skip to content

Use uv for package management#1206

Draft
michplunkett wants to merge 8 commits intodevelopfrom
use-uv-for-install
Draft

Use uv for package management#1206
michplunkett wants to merge 8 commits intodevelopfrom
use-uv-for-install

Conversation

@michplunkett
Copy link
Collaborator

@michplunkett michplunkett commented Feb 13, 2026

Description of Changes

Use the uv package manager instead of virtualenv.

Note: Carried changes over from #1200 so that it built correctly.

Tests and Linting

  • This branch is up-to-date with the develop branch.
  • pytest passes on my local development environment.
  • pre-commit passes on my local development environment.
  • Confirmed it runs locally.
  • Builds normally.
Local Build
michaelp@MacBook-Air-18 OpenOversight % make env
uv venv
Using CPython 3.11.4 interpreter at: /Users/michaelp/.pyenv/versions/3.11.4/bin/python3.11
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
michaelp@MacBook-Air-18 OpenOversight % source .venv/bin/activate
(OpenOversight) michaelp@MacBook-Air-18 OpenOversight % make install
uv pip install -r requirements.txt -r dev-requirements.txt
Resolved 138 packages in 327ms
Installed 138 packages in 301ms
 + alabaster==0.7.16
 + alembic==1.11.3
 + apiclient==1.0.4
 + attrs==23.1.0
 + authlib==1.4.0
 + babel==2.12.1
 + bleach==6.0.0
 + bleach-allowlist==1.0.3
 + blinker==1.6.3
 + bootstrap-flask==2.4.0
 + boto3==1.28.1
 + botocore==1.31.1
 + brotli==1.2.0
 + cachetools==5.3.1
 + certifi==2024.7.4
 + cffi==1.17.1
 + cfgv==3.5.0
 + charset-normalizer==3.4.4
 + click==8.1.4
 + colorama==0.4.6
 + commonmark==0.9.1
 + coverage==6.5.0
 + coveralls==3.3.1
 + cryptography==44.0.1
 + deprecated==1.2.18
 + distlib==0.4.0
 + dnspython==2.6.1
 + docopt==0.6.2
 + docutils==0.20.1
 + dominate==2.8.0
 + email-validator==2.0.0.post2
 + eralchemy2==1.4.1
 + execnet==2.1.2
 + faker==18.13.0
 + filelock==3.21.2
 + flask==2.3.2
 + flask-compress==1.13
 + flask-limiter==3.3.1
 + flask-login==0.6.3
 + flask-mail==0.9.1
 + flask-migrate==4.0.4
 + flask-sitemap==0.4.0
 + flask-sqlalchemy==3.0.5
 + flask-wtf==1.1.2
 + google-api-core==2.29.0
 + google-api-python-client==2.92.0
 + google-auth==2.48.0
 + google-auth-httplib2==0.3.0
 + googleapis-common-protos==1.72.0
 + greenlet==3.3.1
 + gunicorn==22.0.0
 + httplib2==0.22.0
 + identify==2.6.16
 + idna==3.11
 + imagesize==1.4.1
 + importlib-resources==6.5.2
 + iniconfig==2.3.0
 + itsdangerous==2.1.2
 + jellyfish==1.2.1
 + jinja2==3.1.6
 + jmespath==1.0.1
 + limits==3.5.0
 + livereload==2.7.1
 + mako==1.2.4
 + markdown==3.4.3
 + markdown-it-py==4.0.0
 + markupsafe==2.1.3
 + mdurl==0.1.2
 + mock==5.0.2
 + nodeenv==1.10.0
 + nose==1.3.7
 + numpy==2.4.2
 + ordered-set==4.1.0
 + outcome==1.3.0.post0
 + packaging==23.2
 + pandas==3.0.0
 + pep8==1.7.1
 + pillow==10.4.0
 + pip==23.3
 + platformdirs==3.8.1
 + playwright==1.58.0
 + pluggy==1.6.0
 + pre-commit==3.8.0
 + proto-plus==1.27.1
 + protobuf==6.33.5
 + psycopg2==2.9.6
 + pyasn1==0.6.2
 + pyasn1-modules==0.4.2
 + pycparser==2.23
 + pyee==13.0.0
 + pygments==2.15.1
 + pygraphviz==1.14
 + pyparsing==3.3.2
 + pytest==7.4.0
 + pytest-base-url==2.1.0
 + pytest-cache==1.0
 + pytest-cov==4.1.0
 + pytest-pep8==1.0.6
 + pytest-playwright==0.7.0
 + pytest-xdist==3.3.1
 + python-dateutil==2.8.2
 + python-slugify==8.0.4
 + pyyaml==6.0.3
 + recommonmark==0.7.1
 + requests==2.32.1
 + rich==13.4.2
 + rsa==4.9.1
 + s3transfer==0.6.2
 + setuptools==82.0.0
 + six==1.16.0
 + sniffio==1.3.1
 + snowballstemmer==3.0.1
 + sortedcontainers==2.4.0
 + sphinx==7.0.1
 + sphinx-autobuild==2021.3.14
 + sphinxcontrib-applehelp==2.0.0
 + sphinxcontrib-devhelp==2.0.0
 + sphinxcontrib-htmlhelp==2.1.0
 + sphinxcontrib-jsmath==1.0.1
 + sphinxcontrib-qthelp==2.0.0
 + sphinxcontrib-serializinghtml==2.0.0
 + sqlalchemy==1.4.52
 + text-unidecode==1.3
 + tornado==6.5.4
 + trio==0.22.1
 + typing-extensions==4.15.0
 + uritemplate==4.2.0
 + urllib3==1.26.20
 + us==3.2.0
 + virtualenv==20.24.1
 + visitor==0.1.3
 + webencodings==0.5.1
 + werkzeug==3.0.6
 + wrapt==1.15.0
 + wtforms==3.0.1
 + wtforms-sqlalchemy==0.3
 + xvfbwrapper==0.2.9
 + zipp==3.19.1
warning: `requests==2.32.1` is yanked (reason: "Yanked due to conflicts with CVE-2024-35195 mitigation ")
(OpenOversight) michaelp@MacBook-Air-18 OpenOversight % 
  • Make sure build time is quicker with uv than not:
# Without uv
 => [web-test 5/8] RUN curl https://sh.rustup.rs -sSf | sh -s -- -y &&     . "$HOME/.cargo/env" &&     pip3 install --no-cache-dir -r requirements.txt &&     pip3 in  54.9s
# With uv
 => [web-test 5/8] RUN curl https://sh.rustup.rs -sSf | sh -s -- -y &&     . "$HOME/.cargo/env" &&     curl -LsSf https://astral.sh/uv/install.sh | sh &&     export   23.1s

@michplunkett michplunkett self-assigned this Feb 13, 2026
ENV CURL_FLAGS="--proto =https --tlsv1.2 -sSf -L --max-redirs 1 -O"

ENV DEBIAN-FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the variable name: https://askubuntu.com/q/972516

Comment on lines +183 to +187
One way to avoid hitting version incompatibility errors when running `flask` commands is to use a virtualenv.
See [Python Packaging user guidelines](https://packaging.python.org/guides/installing-using-pip-and-virtualenv/)
for instructions on installing [`uv`](https://docs.astral.sh/uv/getting-started/installation/) to manage the virtualenv.
After installing virtualenv, you can create a virtual environment by navigating to the OpenOversight directory and
running the below:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the install instructions.

Comment on lines 92 to +101
lint:
pre-commit run --all-files
uv run pre-commit run --all-files

.PHONY: env
env:
uv venv

.PHONY: install
install:
uv pip install -r requirements.txt -r dev-requirements.txt
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update and add make commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant