-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (40 loc) · 1.1 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
BUILD_PATH='./build'
DEP_PATH='./dep'
help:
@echo "clean - remove all build, test, coverage and Python artifacts"
@echo "lint - check style"
@echo "test - run tests quickly with the default Python"
@echo "coverage - check code coverage quickly with the default Python"
@echo "build - package"
all: clean test deps build
clean:
rm -rf ${BUILD_PATH}
find . -name '__pycache__' -exec rm -rf {} +
rm -f .coverage
rm -rf htmlcov
lint:
flake8 --exit-zero
test:
pipenv run pytest
coverage:
coverage run -m pytest
coverage report -m
coverage html
deps:
mkdir -p ${DEP_PATH}
pipenv lock -r > requirements.txt
pip3 install -r requirements.txt --target ${DEP_PATH}
cd ${DEP_PATH} && zip -9mrv libs.zip .
rm -rf libs && rm requirements.txt
dev-deps:
pipenv lock -rd > requirements.txt
build: clean
mkdir ${BUILD_PATH}
cp main.py ${BUILD_PATH}
mkdir ${BUILD_PATH}/configs
cp configs/config.yaml ${BUILD_PATH}/configs
cp configs/log4j.properties ${BUILD_PATH}
cp configs/logging.json ${BUILD_PATH}
zip -9rv ${BUILD_PATH}/src.zip ./src
mv ${DEP_PATH}/libs.zip ${BUILD_PATH}
rm -r ${DEP_PATH}