-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (36 loc) · 996 Bytes
/
Makefile
File metadata and controls
48 lines (36 loc) · 996 Bytes
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
.PHONY: build shell test lint clean
IMAGE_NAME = pytest-html-plus
SRC_DIR = $(shell pwd)
# Mount local source into container — no rebuild needed on code changes
DOCKER_RUN = docker run --rm \
-v $(SRC_DIR):/app \
-w /app \
$(IMAGE_NAME)
DOCKER_RUN_REPORTS = docker run --rm \
-v $(SRC_DIR):/app \
-w /app \
$(IMAGE_NAME)
build:
docker build -t $(IMAGE_NAME) .
build-with-dev-dependencies:
docker build --build-arg INSTALL_DEV=true -t $(IMAGE_NAME) .
shell:
docker run -it \
-v $(SRC_DIR):/app \
-w /app \
$(IMAGE_NAME) /bin/bash
test:
poetry run pytest tests/unit --reruns 1
test-with-xdist:
$(DOCKER_RUN_REPORTS) poetry run poetry run pytest tests/unit --reruns 1 -n auto
lint:
$(DOCKER_RUN) poetry run ruff check .
fix:
$(DOCKER_RUN) poetry run ruff check . --fix
$(DOCKER_RUN) poetry run ruff format .
install-formatter:
pip install pre-commit
pre-commit install
clean:
docker rmi $(IMAGE_NAME)
rm -rf $(REPORTS_DIR)