forked from nealmadhu/DIRBS-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
90 lines (73 loc) · 3.27 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#
# DIRBS project Makefile
#
# Copyright (c) 2018 Qualcomm Technologies, Inc.
#
# All rights reserved.
#
#
#
# Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
# limitations in the disclaimer below) provided that the following conditions are met:
#
#
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
# disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided with the distribution.
#
# * Neither the name of Qualcomm Technologies, Inc. nor the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY
# THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
.PHONY: clean-pyc install-dev install dist audit test
clean: clean-pyc
rm -rf dist .cache docs/build build dirbs.egg-info dirbs-testreport.xml coverage.xml \
tests/dirbs-testreport.xml
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name *.pyc | grep __pycache__ | xargs rm -rf
install-dev:
pip3 install -r opensource_requirements.txt
pip3 install -e .
install: dist
pip3 install -r dist/opensource_requirements.txt
pip3 install dist/*.whl
dist: clean-pyc
rm -rf dist
python3 setup.py bdist_wheel
cp -a etc dist/
mkdir -p dist/docker
cp -a docker/base docker/prd dist/docker/
cp -a opensource_requirements.txt dist/
cp -a test_requirements.txt.dist dist/test_requirements.txt
mv dist/docker/prd/Makefile.mk dist/docker/prd/Makefile
mkdir -p dist/tests
rsync -aq --exclude='.*' --exclude='__pycache__' --exclude='*.xml' tests/ dist/tests
cp -a pytest.ini.dist dist/tests/pytest.ini
dist_test: dist
pip3 install -r dist/test_requirements.txt
cd dist/tests && py.test --verbose
audit:
pip3 install --upgrade flake8==3.5.0 pep8-naming==0.5.0 flake8-SQL==0.2.0 flake8-builtins==1.0.post0 \
flake8-debugger==3.0.0 flake8-mutable==1.2.0 flake8-import-order==0.16 \
flake8-pep3101==1.2.0 flake8-string-format==0.2.3 flake8-quotes==0.13.0 \
flake8-docstrings==1.3.0
flake8 src scripts tests
eslint src/dirbs/js/*.js
test:
pip3 install -r test_requirements.txt
# We need to run the test in development mode for coverage stats to work
python3 setup.py develop
py.test --verbose