@@ -20,15 +20,17 @@ UV ?= uv $(UV_OPTS)
2020help : # # Display this help text for Makefile
2121 @awk ' BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST )
2222
23- upgrade : # # Upgrade all dependencies to the latest stable versions
23+ upgrade : # # Upgrade all dependencies to the latest stable versions
24+ @echo " => Upgrading pre-commit"
25+ @ (UV_RUN_BIN) run pre-commit autoupdate
2426 @if [ " $( USING_UV) " ]; then $(UV ) lock --upgrade
2527 @echo " Dependencies Updated"
2628
2729# =============================================================================
2830# Developer Utils
2931# =============================================================================
3032
31- install-uv : # # Install latest version of UV
33+ install-uv : # # Install latest version of UV
3234 @echo " => Installing uv"
3335 @curl -LsSf https://astral.sh/uv/install.sh | sh
3436 @echo " => uv installed"
@@ -37,29 +39,51 @@ install-pre-commit: ## Install pre-commit and install hooks
3739 @echo " Installing pre-commit hooks"
3840 @ (UV_RUN_BIN) run pre-commit install --install-hooks --all
3941 @ (UV_RUN_BIN) run pre-commit install --hook-type commit-msg
42+ @echo " => pre-commit hooks installed, updating pre-commit hooks"
43+ @ (UV_RUN_BIN) run pre-commit autoupdate
4044 @echo " pre-commit installed"
4145
4246.PHONY : install-frontend
43- install-frontend : # # Install the frontend dependencies
47+ install-frontend : # # Install the frontend dependencies
4448 @echo " => Installing frontend dependencies"
4549 @nodeenv --python-virtualenv
4650 @npm install
4751 @echo " => Frontend dependencies installed"
4852
4953.PHONY : install-backend
50- install-backend : # # Install the backend dependencies
54+ install-backend : # # Install the backend dependencies
5155 @echo " => Installing backend dependencies"
5256 @$(UV ) venv && $(UV ) pip install --quiet -U wheel setuptools cython mypy pip
5357 @$(UV ) sync --all-extras --force-reinstall --dev
5458 @echo " => Backend dependencies installed"
5559
5660.PHONY : install
57- install : clean destroy # # Install the project, dependencies, and pre-commit for local development
61+ install : clean destroy # # Install the project, dependencies, and pre-commit for local development
5862 @if ! $(UV ) --version > /dev/null; then $(MAKE ) install-uv; fi
5963 @$(MAKE ) install-backend
6064 @$(MAKE ) install-frontend
6165 @echo " => Install complete! Note: If you want to re-install re-run 'make install'"
6266
67+ up-container : # # Start the Byte database container
68+ @echo " => Starting Byte database container"
69+ @docker compose -f docker-compose.infra.yml up -d
70+ @echo " => Started Byte database container"
71+
72+ clean-container : # # Stop, remove, and wipe the Byte database container, volume, network, and orphans
73+ @echo " => Stopping and removing Byte database container, volumes, networks, and orphans"
74+ @docker compose -f docker-compose.infra.yml down -v --remove-orphans
75+ @echo " => Stopped and removed Byte database container, volumes, networks, and orphans"
76+
77+ load-container : up-container migrate # # Perform database migrations and load test data into the Byte database container
78+ @echo " => Loading database migrations and test data"
79+ @$(UV ) run app database upgrade --no-prompt
80+ @echo " rest not yet implemented"
81+ @echo " => Loaded database migrations and test data"
82+
83+ refresh-container : clean-container up-container load-container # # Refresh the Byte database container
84+
85+
86+
6387# =============================================================================
6488# Tests, Linting, Coverage
6589# =============================================================================
@@ -76,6 +100,12 @@ fmt: ## Runs Ruff format, makes changes where necessary
76100ruff : # # Runs Ruff
77101 @$(UV ) run --no-sync ruff check . --unsafe-fixes --fix
78102
103+ ruff-check : # # Runs Ruff without changing files
104+ @$(UV ) run --no-sync ruff check .
105+
106+ ruff-noqa : # # Runs Ruff, adding noqa comments to disable warnings
107+ @$(UV ) run --no-sync ruff check . --add-noqa
108+
79109test : # # Run the tests
80110 @$(UV ) run --no-sync pytest tests
81111
@@ -89,29 +119,29 @@ check-all: lint test fmt-check coverage ## Run all linting, tests, and coverage
89119# =============================================================================
90120# Docs
91121# =============================================================================
92- docs-clean : # # Dump the existing built docs
122+ docs-clean : # # Dump the existing built docs
93123 @echo " => Cleaning documentation build assets"
94124 @rm -rf docs/_build
95125 @echo " => Removed existing documentation build assets"
96126
97- docs-serve : docs-clean # # Serve the docs locally
127+ docs-serve : docs-clean # # Serve the docs locally
98128 @echo " => Serving documentation"
99129 $(UV ) run sphinx-autobuild docs docs/_build/ -j auto --watch byte_bot --watch docs --watch tests --watch CONTRIBUTING.rst --port 8002
100130
101- docs : docs-clean # # Dump the existing built docs and rebuild them
131+ docs : docs-clean # # Dump the existing built docs and rebuild them
102132 @echo " => Building documentation"
103133 @$(UV ) run sphinx-build -M html docs docs/_build/ -E -a -j auto --keep-going
104134
105135# =============================================================================
106136# Database
107137# =============================================================================
108- migrations : # # Generate database migrations
138+ migrations : # # Generate database migrations
109139 @echo " ATTENTION: This operation will create a new database migration for any defined models changes."
110140 @while [ -z " $$ MIGRATION_MESSAGE" ]; do read -r -p " Migration message: " MIGRATION_MESSAGE; done ;
111141 @$(UV ) run app database make-migrations --autogenerate -m " $$ {MIGRATION_MESSAGE}"
112142
113143.PHONY : migrate
114- migrate : # # Apply database migrations
144+ migrate : # # Apply database migrations
115145 @echo " ATTENTION: Will apply all database migrations."
116146 @$(UV ) run app database upgrade --no-prompt
117147
@@ -155,11 +185,11 @@ destroy: ## Destroy the virtual environment
155185run-dev-bot : # # Run the bot in dev mode
156186 @$(UV ) run app run-bot
157187
158- run-dev-server : # # Run the app in dev mode
188+ run-dev-server : up-container # # Run the app in dev mode
159189 @$(UV ) run app run-web --http-workers 1 --reload
160190
161191run-dev-frontend : # # Run the app frontend in dev mode
162192 @$(UV ) run tailwindcss -i byte_bot/server/domain/web/resources/input.css -o byte_bot/server/domain/web/resources/style.css --watch
163193
164- run-dev : # # Run the bot, web, and front end in dev mode
194+ run-dev : up-container # # Run the bot, web, and front end in dev mode
165195 @$(UV ) run app run-all --http-workers 1 -d -v --reload
0 commit comments