Skip to content

Commit 12266fe

Browse files
committed
add Makefile utilities to upgrade dependencies
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent b8e1b0f commit 12266fe

1 file changed

Lines changed: 27 additions & 6 deletions

File tree

Makefile

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,32 @@ dev: virtualenv
4747
@echo "-> Configure and install development dependencies"
4848
uv sync --frozen --extra dev
4949

50+
outdated:
51+
@echo "-> Check for outdated packages (with 7 days cooldown)"
52+
uv pip list --outdated \
53+
--no-config \
54+
--index-url https://pypi.org/simple \
55+
--exclude-newer "7 days"
56+
57+
upgrade:
58+
@if [ -z "$(PACKAGE)" ]; then \
59+
echo "Usage: make upgrade PACKAGE=django==x.x.x"; \
60+
exit 1; \
61+
fi
62+
@echo "-> Download $(PACKAGE) wheels"
63+
@${ACTIVATE} pip download $(PACKAGE) \
64+
--only-binary=:all: \
65+
--platform macosx_11_0_arm64 \
66+
--platform manylinux2014_x86_64 \
67+
--python-version 3.14 \
68+
--dest ./thirdparty/dist/
69+
@echo "-> Update pyproject.toml and uv.lock"
70+
uv add $(PACKAGE)
71+
72+
lock:
73+
@echo "-> Regenerate uv.lock from local wheels"
74+
uv lock
75+
5076
envfile:
5177
@echo "-> Create the .env file and generate a secret key"
5278
@if test -f ${ENV_FILE}; then echo "${ENV_FILE} file exists already"; exit 1; fi
@@ -114,11 +140,6 @@ migrate:
114140
@echo "-> Apply database migrations"
115141
${MANAGE} migrate
116142

117-
upgrade:
118-
@echo "-> Upgrade local git checkout"
119-
@git pull
120-
@$(MAKE) migrate
121-
122143
postgresdb:
123144
@echo "-> Configure PostgreSQL database"
124145
@echo "-> Create database user ${DB_NAME}"
@@ -174,4 +195,4 @@ log:
174195
createsuperuser:
175196
${DOCKER_EXEC} web ./manage.py createsuperuser
176197

177-
.PHONY: virtualenv conf dev envfile envfile_dev doc_dependencies check outdated doc8 valid check-deploy clean initdb postgresdb postgresdb_clean migrate upgrade run test docs build psql bash shell log createsuperuser
198+
.PHONY: virtualenv conf dev lock upgrade envfile envfile_dev doc_dependencies check outdated doc8 valid check-deploy clean initdb postgresdb postgresdb_clean migrate run test docs build psql bash shell log createsuperuser

0 commit comments

Comments
 (0)