-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (42 loc) · 990 Bytes
/
Makefile
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
PACKAGE_NAME=aival
.PHONY: setup
setup:
pip install poetry
poetry config virtualenvs.in-project true # Ensure .venv is created locally
poetry install
.PHONY: activate
activate:
@echo "Run this command to activate the virtual environment:"
@echo "source .venv/bin/activate"
.PHONY: test
test:
poetry run pytest
.PHONY: format
format:
poetry run black src/ tests/
.PHONY: clean
clean:
rm -rf .venv
rm -rf __pycache__/
rm -rf .pytest_cache/
rm -rf .coverage
rm -rf htmlcov
# DOCKER
.PHONY: docker-build
docker-build:
@echo "Building Docker image..."
docker build -t $(PACKAGE_NAME) .
.PHONY: docker-run
docker-run:
@echo "Running the Docker container..."
docker run -p 8000:8000 $(PACKAGE_NAME)
.PHONY: docker-clean
docker-clean:
@echo "Removing Docker image..."
docker rmi $(PACKAGE_NAME)
.PHONY: docker-kill-all
docker-kill-all:
@echo "Run: `docker kill $(docker ps -q)`"
.PHONY: docker-clean-all
docker-clean-all:
@echo "Run: `docker rm $(docker ps -a -q)`"