-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (42 loc) · 1.4 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
50
51
52
current_dir = $(shell pwd)
PROJECT = microdatasets
n ?= auto
DOCKER_ORG = fragiletech
DOCKER_TAG ?= ${PROJECT}
VERSION ?= latest
.POSIX:
style:
black .
isort .
.POSIX:
check:
!(grep -R /tmp tests)
flakehell lint src/${PROJECT}
pylint src/${PROJECT}
black --check src/${PROJECT} notebooks
.PHONY: test
test:
find -name "*.pyc" -delete
pytest -n $n -s -o log_cli=true -o log_cli_level=info
.PHONY: test-codecov
test-codecov:
find -name "*.pyc" -delete
pytest -n $n -s -o log_cli=true -o log_cli_level=info --cov=./src --cov-report=xml --cov-config=pyproject.toml
.PHONY: docker-shell
docker-shell:
docker run --rm -v ${current_dir}:/${PROJECT} --network host -w /${PROJECT} -it ${DOCKER_ORG}/${PROJECT}:${VERSION} bash
.PHONY: docker-notebook
docker-notebook:
docker run --rm -v ${current_dir}:/${PROJECT} --network host -w /${PROJECT} -it ${DOCKER_ORG}/${PROJECT}:${VERSION}
.PHONY: docker-build
docker-build:
docker build --pull -t ${DOCKER_ORG}/${PROJECT}:${VERSION} .
.PHONY: docker-test
docker-test:
find -name "*.pyc" -delete
docker run --rm --network host -w /${PROJECT} --entrypoint python3 ${DOCKER_ORG}/${PROJECT}:${VERSION} -m pytest -n $n -s -o log_cli=true -o log_cli_level=info
.PHONY: docker-push
docker-push:
docker push ${DOCKER_ORG}/${DOCKER_TAG}:${VERSION}
docker tag ${DOCKER_ORG}/${DOCKER_TAG}:${VERSION} ${DOCKER_ORG}/${DOCKER_TAG}:latest
docker push ${DOCKER_ORG}/${DOCKER_TAG}:latest