forked from glm-tools/pyglmnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (71 loc) · 2.05 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# A simple Makefile intended to facilitate repetitive tasks
PYTHON ?= python
CYTHON ?= cython
NOSETESTS ?= nosetests
NOSETESTS_OPTIONS := $(shell pip list | grep nose-timer > /dev/null && \
echo '--with-timer --timer-top-n 50')
# Dependencies installation
.PHONY: dependencies
dependencies:
@echo "#### Installing dependencies ####"
pip install numpy
pip install scipy
@echo "#### All dependencies were installed successfully ####"
# Documentation related commands
# see doc/Makefile for more options
.PHONY: doc
doc:
@echo "#### If there's any Exception, consider to run the command 'make doc-dependencies' ####"
make -C doc html
OS := $(shell uname -s)
DOC := doc/_build/html/index.html
ifeq ($(OS), Linux)
RUN := @xdg-open $(DOC)
else
# OS X
RUN := @open $(DOC)
endif
.PHONY: doc-run
doc-run:
$(RUN)
# Sphinx Dependencies installation
.PHONY: doc-dependencies
doc-dependencies:
pip install sphinx
pip install sphinx-gallery
pip install matplotlib
.PHONY: doc-clean
doc-clean:
make -C doc clean
.PHONY: doc-publish
doc-publish:
make -C doc install
.PHONY: install
install: dependencies
@echo "#### Installing pyglmnet ####"
python setup.py develop install
@echo "#### Pyglmnet installed successfully ####"
@echo "#### Access http://glm-tools.github.io/pyglmnet/index.html for more information and tutorials ####"
.PHONY: all
all: clean test install doc-dependencies doc
.PHOMY: test
test:
clean-pyc:
find . -name "*.pyc" | xargs rm -f
find . -name "__pycache__" | xargs rm -rf
clean-so:
find . -name "*.so" | xargs rm -f
find . -name "*.pyd" | xargs rm -f
clean-build:
rm -rf build
clean: clean-build clean-pyc clean-so doc-clean
test-code:
$(NOSETESTS) -s pyglmnet $(NOSETESTS_OPTIONS)
test-doc:
$(NOSETESTS) -s --with-doctest --doctest-tests --doctest-extension=rst \
--doctest-extension=inc --doctest-fixtures=_fixture `find doc/ -name '*.rst'`
test-coverage:
rm -rf coverage .coverage
$(NOSETESTS) -s --with-coverage --cover-html --cover-html-dir=coverage \
--cover-package=pyglmnet pyglmnet
test: test-code test-doc