Skip to content

Commit 14a5126

Browse files
committed
Switch from pip-tools to uv
Note: pip-tools is making --strip-extras the default in 8.0, which uv has copied by default. This change also ensures a user has uv installed in the local venv so the tooling works, and can take advantage of the python that venv is using.
1 parent 5ee104f commit 14a5126

4 files changed

Lines changed: 18 additions & 23 deletions

File tree

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ help:
66
@echo " make run-prod: run webserver as in deployed environment."
77
@echo " make compile: compile the requirements specs."
88

9+
_uv:
10+
# ensure uv is installed
11+
pip install uv
12+
913
test:
1014
coverage run -m pytest -vvv
1115
coverage report
@@ -14,8 +18,8 @@ mypy:
1418
mypy . | mypy-json-report > mypy-ratchet.json
1519
git diff --exit-code mypy-ratchet.json
1620

17-
build:
18-
pip install -r requirements.prod.txt -r requirements.dev.txt
21+
build: _uv
22+
uv pip install -r requirements.prod.txt -r requirements.dev.txt
1923
python manage.py collectstatic --no-input
2024
rm --force ccbv.sqlite
2125
DATABASE_URL=sqlite:///ccbv.sqlite python manage.py migrate
@@ -24,6 +28,6 @@ build:
2428
run-prod:
2529
DATABASE_URL=sqlite:///ccbv.sqlite gunicorn core.wsgi --log-file -
2630

27-
compile:
28-
pip-compile requirements.prod.in --output-file=requirements.prod.txt
29-
pip-compile requirements.dev.in --output-file=requirements.dev.txt
31+
compile: _uv
32+
uv pip compile requirements.prod.in --output-file=requirements.prod.txt
33+
uv pip compile requirements.dev.in --output-file=requirements.dev.txt

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ After this, install as you normally would a Django site (requirements files are
4848

4949
e.g. (inside your virtualenv or whatever)
5050

51-
pip install -r requirements.prod.txt -r requirements.dev.txt
51+
[uv] pip install -r requirements.prod.txt -r requirements.dev.txt
5252

5353
Prepare the database (assuming you've got required database)
5454

requirements.dev.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#
2-
# This file is autogenerated by pip-compile with Python 3.10
3-
# by the following command:
4-
#
5-
# pip-compile --output-file=requirements.dev.txt requirements.dev.in
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile requirements.dev.in --output-file=requirements.dev.txt
73
attrs==21.4.0
84
# via
95
# -c requirements.prod.txt
@@ -12,7 +8,7 @@ backports-entry-points-selectable==1.2.0
128
# via virtualenv
139
cfgv==3.3.1
1410
# via pre-commit
15-
coverage[toml]==6.5.0
11+
coverage==6.5.0
1612
# via -r requirements.dev.in
1713
distlib==0.3.3
1814
# via virtualenv

requirements.prod.txt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#
2-
# This file is autogenerated by pip-compile with Python 3.10
3-
# by the following command:
4-
#
5-
# pip-compile --output-file=requirements.prod.txt requirements.prod.in
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile requirements.prod.in --output-file=requirements.prod.txt
73
asgiref==3.4.1
84
# via django
95
attrs==21.4.0
@@ -32,7 +28,7 @@ django-sans-db==1.2.0
3228
# via -r requirements.prod.in
3329
docutils==0.17.1
3430
# via sphinx
35-
environs[django]==9.5.0
31+
environs==9.5.0
3632
# via -r requirements.prod.in
3733
gunicorn==20.1.0
3834
# via -r requirements.prod.in
@@ -60,6 +56,8 @@ pytz==2021.3
6056
# via django
6157
requests==2.26.0
6258
# via -r requirements.prod.in
59+
setuptools==70.0.0
60+
# via gunicorn
6361
six==1.16.0
6462
# via blessings
6563
sphinx==1.2.2
@@ -72,6 +70,3 @@ werkzeug==2.0.2
7270
# via -r requirements.prod.in
7371
whitenoise==5.3.0
7472
# via -r requirements.prod.in
75-
76-
# The following packages are considered to be unsafe in a requirements file:
77-
# setuptools

0 commit comments

Comments
 (0)