forked from nanoporetech/sloika
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.common
101 lines (75 loc) · 2.23 KB
/
Makefile.common
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
91
92
93
94
95
96
97
98
99
100
SHELL=/bin/bash
pwd:=$(shell pwd)/
bin:=${pwd}bin/
nproc:=$(shell nproc)
# set this to nothing to get system environment
envCmd?=source $${DEV_VIRTUALENV_DIR}/bin/activate &&
pipInstall:=pip install
inTmpEnv:=source environment && source $${TMP_VIRTUALENV_DIR}/bin/activate &&
inDevEnv:=source environment && ${envCmd}
inEnv:=source environment &&
.PHONY: default
default: testInEnv
.PHONY: test
test: testNoEnv
.PHONY: testInEnv
testInEnv: unitTest
.PHONY: testNoEnv
testNoEnv: unitTestNoEnv
pyTestArgs?=-n 4
unitset?=
unitTestCmd:=${pipInstall} -r test/unit/requirements.txt && cd test/unit && py.test ${pyTestArgs} -v -s --fulltrace ${unitset}
unitTest:
${inDevEnv} ${unitTestCmd}
unitTestFromScratch: cleanTmpEnvWithWheelInstalled
${inTmpEnv} ${unitTestCmd}
unitTestNoEnv:
${unitTestCmd}
.PHONY: cleanDevEnv
cleanDevEnv: cleanVirtualenv
./setup-dev-env.sh
.PHONY: cleanVirtualenv
cleanVirtualenv:
${inEnv} rm -rf $${DEV_VIRTUALENV_DIR}
./setup-virtualenv.sh
.PHONY: cleanTmpEnv
cleanTmpEnv:
source environment && rm -rf $${TMP_VIRTUALENV_DIR} && virtualenv -p python3 $${TMP_VIRTUALENV_DIR}
${inTmpEnv} python -m pip install pip --upgrade
.PHONY: cleanTmpEnvWithDeps
cleanTmpEnvWithDeps: cleanTmpEnv
${inTmpEnv} ${pipInstall} -r scripts/requirements.txt && \
${pipInstall} -r requirements.txt
.PHONY: wheel
wheel: cleanTmpEnvWithDeps
${inTmpEnv} python setup.py bdist_wheel
ls -l dist/*.whl
.PHONY: cleanTmpEnvWithWheelInstalled
cleanTmpEnvWithWheelInstalled: cleanTmpEnv
${inTmpEnv} ${pipInstall} --find-links=dist/ "sloika==${projectVersion}"
.PHONY: autopep8
autopep8:
${inDevEnv} autopep8 --ignore E203 -i --max-line-length=120 ${pyFiles}
.PHONY: pep8
pep8:
${inDevEnv} pep8 --ignore E203,E402 --max-line-length=120 ${pyFiles}
cmd?=echo "Set 'cmd' to command to run in dev env"
.PHONY: runInTmpEnv
runInTmpEnv:
@${inTmpEnv} ${cmd}
.PHONY: clean
clean:
(source environment && rm -rf $${BUILD_DIR})
rm -rf dist/ deb_dist/ *.egg-info/
find . -name '*.pyc' -delete
find . -name '*.so' -delete
.PHONY: pp pullpush
pp: pullpush
pullpush:
${MAKE} pep8
cd data && git pull --rebase && git push
git pull --rebase && git push
.PHONY: debDeps
debDeps: deps
apt-get install -y \
python-stdeb dpkg-dev fakeroot lintian