Skip to content

Commit 1c8b2b7

Browse files
committed
re-organize Makefile
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent d6ed1e1 commit 1c8b2b7

5 files changed

Lines changed: 49 additions & 64 deletions

File tree

Makefile

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ superuser:
4747
${MANAGE} createsuperuser
4848

4949
########################################################################################
50-
# Utilities
50+
# Linters / docs
5151
########################################################################################
5252

5353
DOCS_LOCATION=./docs
@@ -76,36 +76,12 @@ docs:
7676
uvx --from sphinx==9.1.0 --with furo==2025.12.19 sphinx-build -b html ${DOCS_LOCATION} ${DOCS_LOCATION}/_build/html/
7777

7878
########################################################################################
79-
80-
VENV_LOCATION=.venv
81-
ACTIVATE?=. ${VENV_LOCATION}/bin/activate;
82-
#MANAGE=${VENV_LOCATION}/bin/python manage.py
83-
# Do not depend on Python to generate the SECRET_KEY
84-
GET_SECRET_KEY=`head -c50 /dev/urandom | base64 | head -c50`
85-
# Customize with `$ make envfile ENV_FILE=/etc/dejacode/.env`
86-
ENV_FILE=.env
87-
DOCKER_COMPOSE=docker compose -f docker-compose.yml
88-
DOCKER_EXEC=${DOCKER_COMPOSE} exec
89-
DB_NAME=dejacode_db
90-
DB_USERNAME=dejacode
91-
DB_PASSWORD=dejacode
92-
DB_CONTAINER_NAME=db
93-
DB_INIT_FILE=./data/postgresql/initdb.sql.gz
94-
POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8
95-
TIMESTAMP=$(shell date +"%Y-%m-%d_%H%M")
96-
97-
conf: virtualenv
98-
@echo "-> Install dependencies"
99-
uv sync --frozen
100-
@echo "-> Create the var/ directory"
101-
@mkdir -p var
102-
103-
dev: virtualenv
104-
@echo "-> Configure and install development dependencies"
105-
uv sync --frozen --extra dev
79+
# Utilities
80+
########################################################################################
10681

10782
outdated:
10883
@echo "-> Check for outdated packages (with 7 days cooldown)"
84+
uv sync --frozen --quiet
10985
uv pip list --outdated \
11086
--no-config \
11187
--index-url https://pypi.org/simple \
@@ -119,25 +95,61 @@ upgrade:
11995
exit 1; \
12096
fi
12197
@echo "-> Download $(PACKAGE) wheels for Linux x86_64"
122-
pip download $(PACKAGE) \
98+
uvx pip download $(PACKAGE) \
12399
--only-binary=:all: \
124100
--platform manylinux_2_28_x86_64 \
125101
--platform manylinux_2_17_x86_64 \
126102
--python-version 3.14 \
127103
--dest ./thirdparty/dist/
128104
@echo "-> Download $(PACKAGE) wheels for macOS ARM64"
129-
pip download $(PACKAGE) \
105+
uvx pip download $(PACKAGE) \
130106
--only-binary=:all: \
131107
--platform macosx_11_0_arm64 \
132108
--python-version 3.14 \
133109
--dest ./thirdparty/dist/
134110
@echo "-> Update pyproject.toml and uv.lock"
135-
uv add $(PACKAGE)
111+
uvx uv add $(PACKAGE)
136112

137113
lock:
138114
@echo "-> Regenerate uv.lock from local wheels"
139115
uv lock
140116

117+
clean:
118+
@echo "-> Clean the Python env"
119+
rm -rf .venv/ .*_cache/ *.egg-info/ build/ dist/
120+
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
121+
122+
########################################################################################
123+
# Local venv commands (legacy)
124+
########################################################################################
125+
126+
VENV_LOCATION=.venv
127+
ACTIVATE?=. ${VENV_LOCATION}/bin/activate;
128+
#MANAGE=${VENV_LOCATION}/bin/python manage.py
129+
# Do not depend on Python to generate the SECRET_KEY
130+
GET_SECRET_KEY=`head -c50 /dev/urandom | base64 | head -c50`
131+
# Customize with `$ make envfile ENV_FILE=/etc/dejacode/.env`
132+
ENV_FILE=.env
133+
DOCKER_COMPOSE=docker compose -f docker-compose.yml
134+
DOCKER_EXEC=${DOCKER_COMPOSE} exec
135+
DB_NAME=dejacode_db
136+
DB_USERNAME=dejacode
137+
DB_PASSWORD=dejacode
138+
DB_CONTAINER_NAME=db
139+
DB_INIT_FILE=./data/postgresql/initdb.sql.gz
140+
POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8
141+
TIMESTAMP=$(shell date +"%Y-%m-%d_%H%M")
142+
143+
conf: virtualenv
144+
@echo "-> Install dependencies"
145+
uv sync --frozen
146+
@echo "-> Create the var/ directory"
147+
@mkdir -p var
148+
149+
dev: virtualenv
150+
@echo "-> Configure and install development dependencies"
151+
uv sync --frozen --extra dev
152+
141153
envfile:
142154
@echo "-> Create the .env file and generate a secret key"
143155
@if test -f ${ENV_FILE}; then echo "${ENV_FILE} file exists already"; exit 1; fi
@@ -148,15 +160,6 @@ envfile_dev: envfile
148160
@echo "-> Update the .env file for development"
149161
@echo DATABASE_PASSWORD=\"dejacode\" >> ${ENV_FILE}
150162

151-
check-deploy:
152-
@echo "-> Check Django deployment settings"
153-
${MANAGE} check --deploy
154-
155-
clean:
156-
@echo "-> Clean the Python env"
157-
rm -rf .venv/ .*_cache/ *.egg-info/ build/ dist/
158-
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
159-
160163
initdb:
161164
@echo "-> Stop Docker services that access the database"
162165
${DOCKER_COMPOSE} stop web worker
@@ -181,4 +184,4 @@ psql:
181184
log:
182185
${DOCKER_COMPOSE} logs --tail="100" ${SERVICE}
183186

184-
.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 superuser
187+
.PHONY: virtualenv conf dev lock upgrade envfile envfile_dev check outdated doc8 valid clean initdb postgresdb postgresdb_clean migrate run test docs build psql bash shell log superuser

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ dependencies = [
9898
"XlsxWriter==3.2.9",
9999
# Markdown
100100
"markdown==3.10.2",
101-
"bleach==6.3.0",
101+
"bleach==6.4.0",
102102
"bleach_allowlist==1.0.3",
103103
"webencodings==0.5.1",
104104
# Authentication

thirdparty/dist/bleach-6.3.0-py3-none-any.whl.ABOUT

Lines changed: 0 additions & 18 deletions
This file was deleted.
161 KB
Binary file not shown.

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)