22SHELL := /bin/bash
33
44# -- Docker
5- COMPOSE = bin/compose
6- COMPOSE_UP = $(COMPOSE ) up -d --remove-orphans
7- COMPOSE_RUN = $(COMPOSE ) run --rm --no-deps
8- COMPOSE_RUN_DEV_UV = $(COMPOSE_RUN ) dev uv run --project dev
5+ COMPOSE = bin/compose
6+ COMPOSE_UP = $(COMPOSE ) up -d --remove-orphans
7+ COMPOSE_RUN = $(COMPOSE ) run --rm --no-deps
8+ COMPOSE_RUN_DEV_UV = $(COMPOSE_RUN ) dev uv run
9+ COMPOSE_RUN_TYCHO_UV = $(COMPOSE_RUN ) tycho uv run
910
1011default : help
1112
1213# # -- Files
1314.pre-commit-cache :
1415 mkdir .pre-commit-cache
1516
17+ .git/hooks/_commons.inc.sh :
18+ cp bin/_commons.inc.sh .git/hooks/_commons.inc.sh
19+
1620.git/hooks/pre-commit :
1721 cp bin/git-pre-commit-hook .git/hooks/pre-commit
1822
@@ -22,15 +26,18 @@ default: help
2226# ## BOOTSTRAP
2327bootstrap : # # setup development environment (build dev service and install git hooks)
2428bootstrap : \
25- build \
26- jupytext--to-ipynb
29+ build \
30+ migrate \
31+ create-superuser \
32+ jupytext--to-ipynb
2733.PHONY : bootstrap
2834
2935git-hooks : # # install pre-commit hook
3036git-hooks : \
31- .pre-commit-cache \
32- .git/hooks/pre-commit \
33- .git/hooks/commit-msg
37+ .pre-commit-cache \
38+ .git/hooks/_commons.inc.sh \
39+ .git/hooks/pre-commit \
40+ .git/hooks/commit-msg
3441.PHONY : git-hooks
3542
3643# ## BUILD
@@ -46,6 +53,10 @@ build-notebook: ## build custom jupyter notebook image
4653 @$(COMPOSE ) build notebook
4754.PHONY : build-notebook
4855
56+ build-tycho : # # build tycho image
57+ @$(COMPOSE ) build tycho
58+ .PHONY : build-tycho
59+
4960jupytext--to-md : # # convert local ipynb files into md
5061 bin/jupytext --to md ** /* .ipynb
5162.PHONY : jupytext--to-md
@@ -63,6 +74,21 @@ logs-notebook: ## display notebook logs (follow mode)
6374 @$(COMPOSE ) logs -f notebook
6475.PHONY : logs-notebook
6576
77+ logs-tycho : # # display tycho logs (follow mode)
78+ @$(COMPOSE ) logs -f tycho
79+ .PHONY : logs-tycho
80+
81+ # ## Setup
82+ migrate : # # migrate tycho database
83+ @echo " Migrating tycho database…"
84+ @bin/manage migrate
85+ .PHONY : migrate
86+
87+ create-superuser : # # create tycho super user
88+ @echo " Creating tycho super user…"
89+ @bin/manage createsuperuser --noinput || true
90+ .PHONY : create-superuser
91+
6692# ## RUN
6793run-all : # # run the whole stack
6894run-all : \
@@ -78,16 +104,22 @@ run-es: ## run the elasticsearch service
78104 $(COMPOSE_UP ) elasticsearch
79105.PHONY : run-es
80106
107+ run-tycho : # # run the tycho service
108+ $(COMPOSE_UP ) tycho
109+ .PHONY : run-tycho
110+
81111# # LINT
82112# -- Global linting
83113lint : # # lint all sources
84114lint : \
85- lint-notebook
115+ lint-notebook \
116+ lint-tycho
86117.PHONY : lint
87118
88119lint-fix : # # lint and fix all sources
89120lint-fix : \
90- lint-notebook-fix
121+ lint-notebook-fix \
122+ lint-tycho-fix
91123.PHONY : lint-fix
92124
93125# -- Per-service linting
@@ -103,7 +135,41 @@ lint-notebook-fix: ## lint and fix notebook python sources
103135 $(COMPOSE_RUN_DEV_UV ) ruff format src/notebook/
104136.PHONY : lint-notebook-fix
105137
106- # ## MANAGE docker services
138+ lint-tycho : # # lint tycho python sources
139+ lint-tycho : \
140+ lint-tycho-ruff \
141+ lint-tycho-mypy
142+ .PHONY : lint-tycho
143+
144+ lint-tycho-ruff : # # lint tycho python sources with ruff
145+ @echo ' lint:tycho-ruff started…'
146+ $(COMPOSE_RUN_TYCHO_UV ) ruff check .
147+ $(COMPOSE_RUN_TYCHO_UV ) ruff format --check .
148+ .PHONY : lint-tycho-ruff
149+
150+ lint-tycho-ruff-fix : # # lint and fix tycho python sources with ruff
151+ @echo ' lint:tycho-ruff-fix started…'
152+ $(COMPOSE_RUN_TYCHO_UV ) ruff check --fix .
153+ $(COMPOSE_RUN_TYCHO_UV ) ruff format .
154+ .PHONY : lint-tycho-ruff-fix
155+
156+ lint-tycho-mypy : # # lint tycho python sources with mypy
157+ @echo ' lint:tycho-mypy started…'
158+ $(COMPOSE_RUN_TYCHO_UV ) mypy .
159+ .PHONY : lint-tycho-mypy
160+
161+ # # TEST
162+ test : # # test all services
163+ test : \
164+ test-tycho
165+ .PHONY : test
166+
167+ test-tycho : # # test tycho python sources
168+ @echo ' test:tychostarted…'
169+ $(COMPOSE_RUN_TYCHO_UV ) pytest
170+ .PHONY : test-tycho
171+
172+ # # MANAGE docker services
107173status : # # an alias for "docker compose ps"
108174 @$(COMPOSE ) ps
109175.PHONY : status
0 commit comments