-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (40 loc) · 1.12 KB
/
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
.PHONY: all test clean
all test clean:
IMAGE_NAME = platform-reports
venv:
python -m venv venv
. venv/bin/activate; \
python -m pip install --upgrade pip
.PHONY: setup
setup: venv
. venv/bin/activate; \
pip install -e .[dev]; \
pre-commit install
.PHONY: lint
lint:
. venv/bin/activate; \
python -m pre_commit run --all-files
. venv/bin/activate; \
python -m mypy src tests
.PHONY: test-unit
test-unit:
. venv/bin/activate; \
pytest -vv --log-level=INFO --cov=platform_reports --cov-report xml:.coverage.unit.xml tests/unit
.PHONY: test-integration
test-integration:
. venv/bin/activate; \
pytest -vv --log-level=INFO --cov=platform_reports --cov-report xml:.coverage.integration.xml tests/integration
dist: venv setup.cfg pyproject.toml $(shell find src -type f)
make clean-dist
. venv/bin/activate; \
pip install -U build; \
python -m build --wheel ./;
.PHONY: clean-dist
clean-dist:
rm -rf dist
build/image: .dockerignore Dockerfile dist
docker build \
--build-arg PY_VERSION=$$(cat .python-version) \
-t $(IMAGE_NAME):latest .
mkdir -p build
docker image inspect $(IMAGE_NAME):latest -f '{{ .ID }}' > $@