-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (55 loc) · 1.78 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
current_dir = $(shell pwd)
PROJECT = deep_physics
n ?= auto
DOCKER_ORG = fragiletech
DOCKER_TAG ?= ${PROJECT}
VERSION ?= latest
.POSIX:
style:
black .
isort .
.POSIX:
check:
!(grep -R /tmp tests)
flakehell lint ${PROJECT}
pylint ${PROJECT}
black --check ${PROJECT}
.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=./ --cov-report=xml --cov-config=pyproject.toml
.PHONY: pipenv-install
pipenv-install:
rm -rf *.egg-info && rm -rf build && rm -rf __pycache__
rm -f Pipfile && rm -f Pipfile.lock
pipenv install --dev -r requirements-test.txt
pipenv install --pre --dev -r requirements-lint.txt
pipenv install -r requirements.txt
pipenv install -e .
pipenv lock
.PHONY: pipenv-test
pipenv-test:
find -name "*.pyc" -delete
pipenv run pytest -s
.PHONY: docker-shell
docker-shell:
docker run --rm --gpus all -v ${current_dir}:/${PROJECT} --network host -w /${PROJECT} -it ${DOCKER_ORG}/${PROJECT}:${VERSION} bash
.PHONY: docker-notebook
docker-notebook:
docker run --rm --gpus all -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