Debian Codegraph @

Makefile

raw
1 HERE = $(shell pwd)
2 BIN = $(HERE)/bin
3 PYTHON = $(BIN)/python
4 INSTALL = $(BIN)/pip install
5 TOX_VENV ?= py37
6 BUILD_DIRS = bin build include lib lib64 man share
7
8 PYTHON_EXE = $(shell [ -f $(PYTHON) ] && echo $(PYTHON) || echo python)
9 PYPY = $(shell $(PYTHON_EXE) -c "import sys; print(getattr(sys, 'pypy_version_info', False) and 'yes' or 'no')")
10 CI ?= false
11 CI_PYTHON_VERSION ?= $(shell $(PYTHON_EXE) -c "import sys; print('.'.join([str(s) for s in sys.version_info][:2]))")
12
13 GREENLET_SUPPORTED = yes
14 ifeq ($(findstring 3.,$(CI_PYTHON_VERSION)), 3.)
15 GREENLET_SUPPORTED = no
16 VENV_CMD = $(PYTHON_EXE) -m venv .
17 else
18 VENV_CMD = $(PYTHON_EXE) -m virtualenv .
19 endif
20 ifeq ($(PYPY),yes)
21 GREENLET_SUPPORTED = no
22 endif
23
24 .PHONY: all build clean test
25
26 all: build
27
28 $(PYTHON):
29 $(VENV_CMD)
30
31 build: $(PYTHON)
32 ifeq ($(GREENLET_SUPPORTED),yes)
33 $(INSTALL) -U -r requirements_eventlet.txt
34 $(INSTALL) -U -r requirements_gevent.txt
35 endif
36 ifneq ($(CI), true)
37 $(INSTALL) -U -r requirements_sphinx.txt
38 endif
39 $(INSTALL) -U -r requirements.txt
40 $(PYTHON) setup.py develop
41 $(INSTALL) kazoo[test]
42
43 clean:
44 rm -rf $(BUILD_DIRS)
45
46 test:
47 tox -e$(TOX_VENV)
48
49 html:
50 cd docs && \
51 make html