File size: 1,273 Bytes
3c43a5a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
SHELL := /bin/bash

venv:
	python -m venv venv

.PHONY: install
install: ## Install main dependencies
	poetry install --sync

.PHONY: install-dev
install: ## Install dependencies including dev dependencies such as test and docs
	poetry install --sync --with test,docs

.PHONY: ruff
ruff:
	ruff check .

.PHONY: bandit
bandit:
	bandit -r . -c pyproject.toml

.PHONY: mypy
mypy:
	mypy . --config-file pyproject.toml

.PHONY: style
style:
	ruff check . --fix
	mypy . --config-file pyproject.toml
	bandit -r . -c pyproject.toml

.PHONY: run
run:
	python -m $(demo).app

.PHONY: build
build:
	docker build -t $(CONTAINER_REGISTRY)/$(IMAGE_NAME):$(or $(tag), $(DEFAULT_IMAGE_TAG)) .

.PHONY: push
push:
	docker push $(CONTAINER_REGISTRY)/$(IMAGE_NAME):$(or $(tag), $(DEFAULT_IMAGE_TAG))

.PHONY: docker-run
docker-run:
	docker run -it --rm -p 7860:7860 \
	$(CONTAINER_REGISTRY)/$(IMAGE_NAME):$(or $(tag), $(DEFAULT_IMAGE_TAG)) \
	python -m $(demo).app

.PHONY: clean
clean:
	find . -type f -name "*.DS_Store" -ls -delete
	find . | grep -E "(__pycache__|\.pyc|\.pyo)" | xargs rm -rf
	find . | grep -E ".pytest_cache" | xargs rm -rf
	find . | grep -E ".mypy_cache" | xargs rm -rf
	find . | grep -E ".ruff_cache" | xargs rm -rf
	find . | grep -E ".ipynb_checkpoints" | xargs rm -rf