generated from softwareone-platform/swo-extension-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.mk
More file actions
43 lines (31 loc) · 1.08 KB
/
common.mk
File metadata and controls
43 lines (31 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
DC = docker compose -f compose.yaml
RUN = $(DC) run --rm app
RUN_IT = $(DC) run --rm -it app
bash: ## Open a bash shell
$(RUN_IT) bash
build: ## Build images
$(DC) build
check: ## Check code quality
$(RUN) bash -c "ruff format --check . && ruff check . && flake8 . && mypy . && uv lock --check"
check-all: check test ## Run checks and tests
down: ## Stop and remove containers
$(DC) down
format: ## Format code
$(RUN) bash -c "ruff check --select I --fix . && ruff format ."
run: ## Run service
$(DC) up
shell: ## Open Django shell
$(RUN_IT) bash -c "swoext shell"
test: ## Run test
$(RUN) pytest $(if $(args),$(args),.)
uv-add: ## Add a production dependency (pkg=<package_name>)
$(call require,pkg)
$(RUN) bash -c "uv add $(pkg)"
$(MAKE) build
uv-add-dev: ## Add a dev dependency (pkg=<package_name>)
$(call require,pkg)
$(RUN) bash -c "uv add --dev $(pkg)"
$(MAKE) build
uv-upgrade: ## Upgrade all packages or a specific package (use pkg="package_name" to target one)
$(RUN) bash -c "uv lock $(if $(pkg),--upgrade-package $(pkg),--upgrade) && uv sync"
$(MAKE) build