-
Notifications
You must be signed in to change notification settings - Fork 156
/
Makefile
48 lines (40 loc) · 1.8 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
# Makefile for mesh package
package_name := mesh_package
all:
@echo "\033[0;36m----- [" ${package_name} "] Installing with the interpreter `which python` (version `python --version | cut -d' ' -f2`)\033[0m"
@pip install --upgrade -r requirements.txt && pip list
@pip install --no-deps --install-option="--boost-location=$$BOOST_INCLUDE_DIRS" --verbose --no-cache-dir .
import_tests:
@echo "\033[0;33m----- [" ${package_name} "] Performing import tests\033[0m"
@PSBODY_MESH_CACHE=`mktemp -d -t mesh_package.XXXXXXXXXX` python -c "from psbody.mesh.mesh import Mesh"
@python -c "from psbody.mesh.meshviewer import MeshViewers"
@echo "\033[0;33m----- [" ${package_name} "] OK import tests\033[0m"
unit_tests:
@if test "$(USE_NOSE)" = "" ; then \
echo "\033[0;33m----- [" ${package_name} "] Running tests using unittest, no report file\033[0m" ; \
PSBODY_MESH_CACHE=`mktemp -d -t mesh_package.XXXXXXXXXX` python -m unittest -v ; \
else \
echo "\033[0;33m----- [" ${package_name} "] Running tests using nosetests\033[0m" ; \
pip install nose ; \
PSBODY_MESH_CACHE=`mktemp -d -t mesh_package.XXXXXXXXXX` nosetests -v --with-xunit; \
fi ;
tests: import_tests unit_tests
# Creating source distribution
sdist:
@echo "\033[0;33m----- [" ${package_name} "] Creating the source distribution\033[0m"
@python setup.py sdist
# Creating wheel distribution
wheel:
@echo "\033[0;33m----- [" ${package_name} "] Creating the wheel distribution\033[0m"
@pip install wheel
@python setup.py --verbose build_ext --boost-location=$$BOOST_INCLUDE_DIRS bdist_wheel
# Build documentation
documentation:
@echo "\033[0;33m----- [" ${package_name} "] Building Sphinx documentation\033[0m"
@pip install -U sphinx sphinx_bootstrap_theme
@cd doc && make html
clean:
@rm -rf build
@rm -rf dist
@rm -rf psbody_mesh.egg-info
@rm -rf *.xml