@@ -2,6 +2,7 @@ PYTHON_BINS ?= ./.venv/bin
2
2
PYTHON ?= ${PYTHON_BINS}/python
3
3
DJANGO_SETTINGS_MODULE ?= project.settings.development
4
4
SUB_MAKE = ${MAKE} --no-print-directory
5
+ UV ?= bin/uv
5
6
6
7
.DEFAULT_GOAL := help
7
8
10
11
@grep -P '^[.a-zA-Z/_-]+:.*?# # .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
11
12
12
13
.PHONY : install
13
- install : bin/uv .venv ./node_modules # # Install the Python and frontend dependencies
14
- bin/uv sync --all-extras
15
- ${PYTHON_BINS} /pre-commit install
16
- ${SUB_MAKE} .venv/bin/black
14
+ install : backend/install frontend/install # # Install the Python and frontend dependencies
15
+
17
16
18
17
.PHONY : dev
19
18
dev : .env.local db.sqlite3
@@ -31,6 +30,13 @@ download_assets: download_assets_opts ?=
31
30
download_assets :
32
31
${PYTHON_BINS} /python scripts/download_assets.py ${download_assets_opts}
33
32
33
+ .PHONY : backend/install
34
+ backend/install : uv_sync_opts ?= --all-extras --no-build
35
+ backend/install : bin/uv .venv # # Install the Python dependencies (via uv) and install pre-commit
36
+ ${UV} sync ${uv_sync_opts}
37
+ ${PYTHON_BINS} /pre-commit install
38
+ @${SUB_MAKE} .venv/bin/black
39
+
34
40
.PHONY : backend/watch
35
41
backend/watch : address ?= localhost
36
42
backend/watch : port ?= 8000
@@ -83,8 +89,12 @@ code-quality/mypy: ## Python's equivalent of TypeScript
83
89
84
90
# Here starts the frontend stuff
85
91
92
+ .PHONY : frontend/install
93
+ frontend/install : # # Install the frontend dependencies (via npm)
94
+ npm install
95
+
86
96
.PHONY : frontend/watch
87
- frontend/watch : # # Compile the CSS & JS assets of our various Django apps, in 'watch' mode
97
+ frontend/watch : ./node_modules # # Compile the CSS & JS assets of our various Django apps, in 'watch' mode
88
98
@./node_modules/.bin/concurrently --names " img,css,js" --prefix-colors " yellow,green" \
89
99
" ${SUB_MAKE} frontend/img" \
90
100
" ${SUB_MAKE} frontend/css/watch" \
@@ -150,7 +160,7 @@ bin/uv: # Install `uv` and `uvx` locally in the "bin/" folder
150
160
@echo " We'll use 'bin/uv' to manage Python dependencies."
151
161
152
162
.venv : # # Initialises the Python virtual environment in a ".venv" folder, via uv
153
- bin/uv venv
163
+ ${UV} venv
154
164
155
165
.env.local :
156
166
cp .env.dist .env.local
@@ -179,8 +189,6 @@ django/manage: .venv .env.local ## Run a Django management command
179
189
180
190
./node_modules : frontend/install
181
191
182
- frontend/install :
183
- npm install
184
192
185
193
# Here starts the "Lichess database" stuff
186
194
0 commit comments