-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
55 lines (39 loc) · 1.63 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
module="SafeRLBench"
GREEN=\033[0;32m
NC=\033[0m
# Flake 8 ignore errors
flakeignore='E402,W503'
# Pydocstyle ignore errors
pydocignore='D105'
style:
@echo "${GREEN}Running style tests:${NC}"
@flake8 ${module} --exclude test*.py,__init__.py --show-source
@flake8 ${module} --filename=__init__.py,test*.py --ignore=F --show-source
docstyle:
@echo "${GREEN}Testing docstring conventions:${NC}"
@pydocstyle ${module} --match='(?!__init__).*\.py' 2>&1 | grep -v "WARNING: __all__"
unittests:
@echo "${GREEN}Running unit tests in current environment.${NC}"
@nosetests -v --with-doctest --with-coverage --cover-erase --cover-package=${module} ${module} 2>&1 | grep -v "^Level 1"
coverage: unittests
@echo "${GREEN}Create coverage report:${NC}"
@coverage html
test: style docstyle unittests
# targets to setup docker images for testing
setup_docker2:
docker build -f misc/Dockerfile.python2 -t srlb-py27-image .
setup_docker3:
docker build -f misc/Dockerfile.python3 -t srlb-py35-image .
setup_docker: setup_docker2 setup_docker3
docker2:
@echo "${GREEN}Running unit tests for 2.7 in docker container:${NC}"
@docker run -e "TF_CPP_MIN_LOG_LEVEL=2" -v $(shell pwd):/code/ srlb-py27-image nosetests --with-doctest --verbosity=2 SafeRLBench 2>&1 | grep -v "^Level "
docker3:
@echo "${GREEN}Running unit tests for 3.5 in docker container:${NC}"
@docker run -e "TF_CPP_MIN_LOG_LEVEL=2" -v $(shell pwd):/code/ srlb-py35-image nosetests --with-doctest --verbosity=2 SafeRLBench 2>&1 | grep -v "^Level "
docker: docker2 docker3
history:
git log --graph --decorate --oneline
clean:
find . -type f -name '*.pyc' -exec rm -f {} ';'
rm -r htmlcov