forked from MassimoLauria/cnfgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (50 loc) · 1.32 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
PROJECT=cnfgen
PYTHON_BIN = python2
VIRTUALENV = $(HOME)/.virtualenvs/$(PROJECT)-venv
all : test
.PHONY: test install package upload devinstall docbuild editor-tools doc-tools venv
test: venv
. $(VIRTUALENV)/bin/activate && \
python setup.py nosetests --with-doctest
install:
python setup.py install --user --prefix=
clean:
rm -fr build
rm -fr dist
rm -fr *.egg-info
rm -fr docs/_build
find . -name '*.pyc' -delete
find . -name 'flycheck*.py' -delete
package: clean
python setup.py sdist bdist bdist_egg bdist_wheel
upload: package
twine upload dist/*
#
# Develop
#
devinstall: venv
. $(VIRTUALENV)/bin/activate && \
python setup.py install
docbuild: devinstall
. $(VIRTUALENV)/bin/activate && \
sphinx-apidoc -e -o docs cnfformula cnfformula/tests/ && \
$(MAKE) -C docs html
#
# Install tools
#
editor-tools : venv
. $(VIRTUALENV)/bin/activate && \
pip install pylint nose
doc-tools : venv
. $(VIRTUALENV)/bin/activate && \
pip install sphinx sphinx-autobuild numpydoc sphinx_rtd_theme
#
# virtualenv setup
#
venv: $(VIRTUALENV)/bin/activate
$(VIRTUALENV)/bin/activate: requirements.txt
type pip >/dev/null || easy_install --user pip
type virtualenv>/dev/null || easy_install --user virtualenv
test -d $(VIRTUALENV) || virtualenv -p $(PYTHON_BIN) $(VIRTUALENV)
. $@ && pip install -Ur requirements.txt
touch $@