forked from nanoporetech/fast5_research
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (37 loc) · 1.57 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
.PHONY: install test develop deb docs clean
SHELL=/bin/bash
PKG_NAME=fast5_research
# We could create custom docker images for CI builds with the venv pre-installed
# to /root/venv when the docker images is build so our CI builds run fast. To
# allow us to use the same Makefile locally, assume that if /root/venv exists,
# we are on a docker image, so don't need to create a venv, else we are local
# and need to.
VENV_DIR=$(shell eval 'if [ -d /root/venv ]; then echo /root/venv; else echo `pwd`/venv/${PKG_NAME}; fi')
VENV=${VENV_DIR}/bin/activate
START_DIR=$(shell pwd)
venv:
# if venv exists, do nothing, else create venv and install all dependencies
test -d ${VENV_DIR} || virtualenv -p python2 ${VENV_DIR};
. ${VENV} && pip install --upgrade pip;
. ${VENV} && pip install -r dev_requirements.txt;
. ${VENV} && pip install -r requirements.txt;
install: venv clean
. ${VENV} && python setup.py install
test: develop
. ${VENV} && nosetests
develop: clean
. ${VENV} && python setup.py develop
sdist: clean
. ${VENV} && python setup.py sdist
test_sdist:
virtualenv test_sdist && . test_sdist/bin/activate && pip install --upgrade pip && pip install -f ./dist/ $(PKG_NAME)
deb: clean
. ${VENV} && python setup.py --command-packages=stdeb.command sdist_dsc --debian-version 1~$(VERSION_TAG) bdist_deb
docs:
. ${VENV} && sphinx-apidoc --no-toc -o docs/api $(PKG_NAME)
. ${VENV} && python setup.py build_sphinx
clean: venv
. ${VENV} && python setup.py clean
rm -rf dist/ deb_dist/ *.egg-info/
find ./${PKG_NAME} -name '*.pyc' -delete
find ./${PKG_NAME} -name '*.so' -delete