-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
73 lines (56 loc) · 1.75 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
68
69
70
71
72
73
docker_tag="ablator"
docker_build_args=""
test_tag=""
tests="."
.PHONY: test
test:
# running outside a docker container
pytest ${tests} \
--docker-tag ${docker_tag} \
--reruns 2 \
--reruns-delay 10 \
-n=0 ${test_tag}
in-docker-test:
# for running tests inside a docker container we must
# specify volume and mv coverage file on shared directory
pytest ${tests} \
--docker-tag ${docker_tag} \
--volume-name ${docker_tag}-volume \
--reruns 2 \
--reruns-delay 10 \
-n=0 ${test_tag}
mv coverage.xml shared/_coverage.xml
clean-docker:
-docker kill $(docker ps --filter ancestor=${docker_tag} -q)
docker container prune -f
-docker volume rm ${docker_tag}-volume
docker:
mkdir -p shared
bash scripts/make_docker.sh ${docker_build_args} ${docker_tag}
run-docker: docker
bash scripts/run_docker.sh --it --docker-tag ${docker_tag} bash
run-docker-clean: clean-docker docker
bash scripts/run_docker.sh --it --docker-tag ${docker_tag} bash
docker-test: clean-docker docker
bash scripts/run_docker.sh --docker-tag ${docker_tag} \
make in-docker-test test_tag=\"${test_tag}\" docker_tag=\"${docker_tag}\" tests=\"${tests}\"
mv shared/_coverage.xml shared/coverage_gpu_$(lastword $(test_tag)).xml
docker-test-cpu: clean-docker docker
bash scripts/run_docker.sh --cpu --docker-tag ${docker_tag} \
make in-docker-test test_tag=\"${test_tag}\" docker_tag=${docker_tag} tests=\"${tests}\"
mv shared/_coverage.xml shared/coverage_cpu_$(lastword $(test_tag)).xml
install:
pip install -e ."[dev]" -v
flake8:
flake8 ./ablator/ --count --show-source --statistics
flake8 --ignore=F841,W503,DOC ./tests/
black:
black --check --preview .
pylint:
pylint ablator
mypy:
mypy ablator
static-tests: black flake8 mypy pylint
echo "Done"
package:
bash scripts/package.sh