-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
64 lines (46 loc) · 1.15 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
#
# api/Makefile ---
#
ifeq (${API_DIR},)
$(error source ./ht-setup.env first.)
endif
SHELL:=bash
.SUFFIXES:
#####
_default: _ve_build
#####
_apt_get_install:
# For python3
sudo apt-get install -y python3 python3-venv python3-setuptools python3-wheel
_brew_install:
# For python3 for OSX
brew install python3
# Use brew pip3 to install packages
/usr/local/bin/pip3 install wheel setuptools
#####
sys_python3_exe=$(shell PATH=/usr/bin:/usr/local/bin:${PATH} type -p python3)
# check they are set.
ifeq (${sys_python3_exe},)
$(error the system python3 was not found.)
endif
sys_virtualenv_cmd:=${sys_python3_exe} -m venv
ve_python3_exe:=${API_VE_DIR}/bin/python3
ve_pip3_cmd:=${ve_python3_exe} -m pip
api_install_cmd:=${ve_pip3_cmd} install --editable ${API_DIR}
_ve_build:
# build ve
${sys_python3_exe} -m venv ${API_DIR}/ve
# pip update
${ve_pip3_cmd} install --upgrade pip setuptools wheel
# extra packages
${ve_pip3_cmd} install -r requirements.txt
# install ourselves.
# ${ve_pip3_cmd} install -e .
_ve_rm:
rm -rf ${API_VE_DIR}
_ve_rebuild: _ve_rm _ve_build
_tests:
cd tests && \
python3 -m unittest tests.py
${API_VE_DIR}:
make _ve_build