-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (49 loc) · 1.36 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
ifeq ($(OS),Windows_NT)
CUR_DIR = $(shell cd)
PYTHON=python
PIP=python -m pip
SHELL=cmd
CMD_SEPARATOR=&
VENV_ACTIVATE=.\env\Scripts\activate
NALU_WHEEL=nalu --no-index --find-links=${CUR_DIR}\dist
RM=- rmdir /S /Q
MAKE=make.exe
env/bin/activate:
IF NOT EXIST env ${PYTHON} -m venv env ${CMD_SEPARATOR} \
${VENV_ACTIVATE} ${CMD_SEPARATOR} \
${PIP} install --upgrade pip ${CMD_SEPARATOR} \
${PIP} install -Ur requirements.txt
test: install-nalu test-headless
else
CUR_DIR = $(shell pwd)
PYTHON=python3
PIP=pip3
CMD_SEPARATOR=;
VENV_ACTIVATE=. ./env/bin/activate
NALU_WHEEL=nalu --no-index --find-links=${CUR_DIR}/dist
RM=rm -rf
env/bin/activate:
test -d env || ${PYTHON} -m venv env ${CMD_SEPARATOR} \
${VENV_ACTIVATE} ${CMD_SEPARATOR} \
${PIP} install --upgrade pip ${CMD_SEPARATOR} \
${PIP} install -Ur requirements.txt
test: install-nalu test-headless
endif
SRC = src/nalu/*.py
all: dist
.PHONY: env release-version
env: env/bin/activate
test-headless: env
${VENV_ACTIVATE} ${CMD_SEPARATOR} \
coverage run -m pytest
dist: $(SRC) release-version env
${VENV_ACTIVATE} ${CMD_SEPARATOR} \
${PIP} install wheel ${CMD_SEPARATOR} \
${PYTHON} setup.py bdist_wheel --universal
install-nalu: env dist
${VENV_ACTIVATE} ${CMD_SEPARATOR} \
${PIP} uninstall -y nalu ${CMD_SEPARATOR} \
${PIP} install --no-cache-dir ${NALU_WHEEL}
clean:
${RM} dist
${RM} env