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
@@ -23,6 +24,8 @@ default: help
2324bootstrap : # # setup development environment (build dev service and install git hooks)
2425bootstrap : \
2526 build \
27+ migrate \
28+ create-superuser \
2629 jupytext--to-ipynb
2730.PHONY : bootstrap
2831
@@ -46,6 +49,10 @@ build-notebook: ## build custom jupyter notebook image
4649 @$(COMPOSE ) build notebook
4750.PHONY : build-notebook
4851
52+ build-tycho : # # build tycho image
53+ @$(COMPOSE ) build tycho
54+ .PHONY : build-tycho
55+
4956jupytext--to-md : # # convert local ipynb files into md
5057 bin/jupytext --to md ** /* .ipynb
5158.PHONY : jupytext--to-md
@@ -63,6 +70,21 @@ logs-notebook: ## display notebook logs (follow mode)
6370 @$(COMPOSE ) logs -f notebook
6471.PHONY : logs-notebook
6572
73+ logs-tycho : # # display tycho logs (follow mode)
74+ @$(COMPOSE ) logs -f tycho
75+ .PHONY : logs-tycho
76+
77+ # ## Setup
78+ migrate : # # migrate tycho database
79+ @echo " Migrating tycho database…"
80+ @bin/manage migrate
81+ .PHONY : migrate
82+
83+ create-superuser : # # create tycho super user
84+ @echo " Creating tycho super user…"
85+ @bin/manage createsuperuser --noinput || true
86+ .PHONY : create-superuser
87+
6688# ## RUN
6789run-all : # # run the whole stack
6890run-all : \
@@ -78,16 +100,22 @@ run-es: ## run the elasticsearch service
78100 $(COMPOSE_UP ) elasticsearch
79101.PHONY : run-es
80102
103+ run-tycho : # # run the tycho service
104+ $(COMPOSE_UP ) tycho
105+ .PHONY : run-tycho
106+
81107# # LINT
82108# -- Global linting
83109lint : # # lint all sources
84110lint : \
85- lint-notebook
111+ lint-notebook \
112+ lint-tycho
86113.PHONY : lint
87114
88115lint-fix : # # lint and fix all sources
89116lint-fix : \
90- lint-notebook-fix
117+ lint-notebook-fix \
118+ lint-tycho-fix
91119.PHONY : lint-fix
92120
93121# -- Per-service linting
@@ -103,7 +131,41 @@ lint-notebook-fix: ## lint and fix notebook python sources
103131 $(COMPOSE_RUN_DEV_UV ) ruff format src/notebook/
104132.PHONY : lint-notebook-fix
105133
106- # ## MANAGE docker services
134+ lint-tycho : # # lint tycho python sources
135+ lint-tycho : \
136+ lint-tycho-ruff \
137+ lint-tycho-mypy
138+ .PHONY : lint-tycho
139+
140+ lint-tycho-ruff : # # lint tycho python sources with ruff
141+ @echo ' lint:tycho-ruff started…'
142+ $(COMPOSE_RUN_TYCHO_UV ) ruff check .
143+ $(COMPOSE_RUN_TYCHO_UV ) ruff format --check .
144+ .PHONY : lint-tycho-ruff
145+
146+ lint-tycho-ruff-fix : # # lint and fix tycho python sources with ruff
147+ @echo ' lint:tycho-ruff-fix started…'
148+ $(COMPOSE_RUN_TYCHO_UV ) ruff check --fix .
149+ $(COMPOSE_RUN_TYCHO_UV ) ruff format .
150+ .PHONY : lint-tycho-ruff-fix
151+
152+ lint-tycho-mypy : # # lint tycho python sources with mypy
153+ @echo ' lint:tycho-mypy started…'
154+ $(COMPOSE_RUN_TYCHO_UV ) mypy .
155+ .PHONY : lint-tycho-mypy
156+
157+ # # TEST
158+ test : # # test all services
159+ test : \
160+ test-tycho
161+ .PHONY : test
162+
163+ test-tycho : # # test tycho python sources
164+ @echo ' test:tychostarted…'
165+ $(COMPOSE_RUN_TYCHO_UV ) pytest
166+ .PHONY : test-tycho
167+
168+ # # MANAGE docker services
107169status : # # an alias for "docker compose ps"
108170 @$(COMPOSE ) ps
109171.PHONY : status
0 commit comments