66# See https://aboutcode.org for more information about AboutCode FOSS projects.
77#
88
9- PYTHON_EXE =python3.14
109VENV_LOCATION =.venv
1110ACTIVATE? =. ${VENV_LOCATION}/bin/activate;
1211MANAGE =${VENV_LOCATION}/bin/python manage.py
1312# Do not depend on Python to generate the SECRET_KEY
1413GET_SECRET_KEY =` head -c50 /dev/urandom | base64 | head -c50 `
15- PIP_ARGS=--find-links =./thirdparty/dist/ --no-index --no-cache-dir
1614# Customize with `$ make envfile ENV_FILE=/etc/dejacode/.env`
1715ENV_FILE =.env
1816DOCS_LOCATION =./docs
3634endif
3735
3836virtualenv :
39- @echo " -> Bootstrap the virtualenv with PYTHON_EXE= ${PYTHON_EXE} "
40- ${PYTHON_EXE} -m venv ${VENV_LOCATION}
37+ @echo " -> Bootstrap the virtualenv with uv "
38+ uv venv --allow-existing ${VENV_LOCATION}
4139
4240conf : virtualenv
4341 @echo " -> Install dependencies"
44- @ ${ACTIVATE} pip install ${PIP_ARGS} --editable .
42+ uv sync --frozen
4543 @echo " -> Create the var/ directory"
4644 @mkdir -p var
4745
4846dev : virtualenv
4947 @echo " -> Configure and install development dependencies"
50- @${ACTIVATE} pip install ${PIP_ARGS} --editable .[dev]
48+ uv sync --frozen --extra dev
49+
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
5175
5276envfile :
5377 @echo " -> Create the .env file and generate a secret key"
@@ -59,14 +83,9 @@ envfile_dev: envfile
5983 @echo " -> Update the .env file for development"
6084 @echo DATABASE_PASSWORD=\" dejacode\" >> ${ENV_FILE}
6185
62- doc_dependencies : virtualenv
63- @echo " -> Configure and install documentation dependencies"
64- @${ACTIVATE} pip install --editable .[docs]
65-
6686doc8 :
6787 @echo " -> Run documentation .rst validation"
68- @$(MAKE ) doc_dependencies > /dev/null 2>&1
69- @${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/
88+ uvx doc8==2.0.0 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/
7089
7190valid :
7291 @echo " -> Run Ruff format"
@@ -116,11 +135,6 @@ migrate:
116135 @echo " -> Apply database migrations"
117136 ${MANAGE} migrate
118137
119- upgrade :
120- @echo " -> Upgrade local git checkout"
121- @git pull
122- @$(MAKE ) migrate
123-
124138postgresdb :
125139 @echo " -> Configure PostgreSQL database"
126140 @echo " -> Create database user ${DB_NAME} "
@@ -152,9 +166,8 @@ test:
152166docs :
153167 @echo " -> Builds the documentation"
154168 rm -rf ${DOCS_LOCATION} /_build/
155- @$(MAKE ) doc_dependencies > /dev/null 2>&1
156- @${ACTIVATE} sphinx-build -b singlehtml ${DOCS_LOCATION} ${DOCS_LOCATION} /_build/singlehtml/
157- @${ACTIVATE} sphinx-build -b html ${DOCS_LOCATION} ${DOCS_LOCATION} /_build/html/
169+ uvx --from sphinx==9.1.0 --with furo==2025.12.19 sphinx-build -b singlehtml ${DOCS_LOCATION} ${DOCS_LOCATION} /_build/singlehtml/
170+ uvx --from sphinx==9.1.0 --with furo==2025.12.19 sphinx-build -b html ${DOCS_LOCATION} ${DOCS_LOCATION} /_build/html/
158171
159172build :
160173 @echo " -> Build the Docker image"
176189createsuperuser :
177190 ${DOCKER_EXEC} web ./manage.py createsuperuser
178191
179- .PHONY : virtualenv conf dev envfile envfile_dev doc_dependencies check doc8 valid check-deploy clean initdb postgresdb postgresdb_clean migrate upgrade run test docs build psql bash shell log createsuperuser
192+ .PHONY : virtualenv conf dev lock upgrade envfile envfile_dev check outdated doc8 valid check-deploy clean initdb postgresdb postgresdb_clean migrate run test docs build psql bash shell log createsuperuser
0 commit comments