-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
51 lines (42 loc) · 984 Bytes
/
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
HERE = $(shell pwd)
BIN = $(HERE)/bin
CIRCLECI ?= false
TESTS ?= genc
ifeq ("$(TESTS)", "genc")
TEST_ARG = --cov-config=.coveragerc --cov=genc genc
else
TEST_ARG = $(TESTS)
endif
ifeq ($(CIRCLECI), true)
PYTHON_VERSION = $(shell python -c "import sys; print('.'.join([str(s) for s in sys.version_info][:2]))")
PYTHON_2 = yes
ifeq ($(findstring 3.,$(PYTHON_VERSION)), 3.)
PYTHON_2 = no
endif
endif
INSTALL = $(BIN)/pip install --no-deps --disable-pip-version-check
.PHONY: all build clean data python test
all: build
python:
ifeq ($(CIRCLECI), true)
ifeq ("$(PYTHON_2)", "yes")
python -m virtualenv .
else
python -m venv .
endif
endif
build: python
ifeq ($(CIRCLECI), true)
$(INSTALL) -r requirements/test.txt
python setup.py develop
endif
data:
python3.6 build.py "data/GENC Standard XML Ed3.0.zip"
test:
ifeq ($(CIRCLECI), true)
$(BIN)/pytest $(TEST_ARG)
else
circleci build --job python-2.7
circleci build --job python-3.5
circleci build --job python-3.6
endif