-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile
79 lines (64 loc) · 2.31 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
help:
@echo \#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#
@echo \# LEAP Makefile
@echo \#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#
@echo \#
@echo "# make venv Create a virtual environment"
@echo "# source venv/bin/activate Activate it"
@echo \#
@echo "# make setup Install LEAP & minimal dependencies"
@echo "# make depend Install test/optional dependencies"
@echo "# make doc Build docs (in docs/build/html/)"
@echo "# make dist Create package (i.e. for PyPI)"
@echo \#
@echo "# make pep8 Check for PEP8 compliance"
@echo "# make test Run fast and slow test suites"
@echo "# make test-fast Run fast test suite"
@echo "# make test-slow Run slow test suite"
@echo "# make kernel Setup Jupyter for tests"
@echo "# make test-jupyter Test the Jupyter examples"
@echo \#
@echo \#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#
@echo
venv:
python3 -m venv --system-site-packages ./venv
@echo
@echo Built virtual environment in ./venv
@echo Run \'source venv/bin/activate\' to activate it!
.PHONY: doc setup test test-fast test-slow kernel test-jupyter clean
doc:
pip install -r docs/requirements.txt
# The apidoc call is long because we need to tell it to
# use the venv's version of sphinx-build
sphinx-apidoc -f -o docs/source/ leap_ec/ SPHINXBUILD='python $(shell which sphinx-build)'
cd docs && make html
setup:
pip install -e .
pip install -r test_requirements.txt
depend:
pip install -r requirements_freeze.txt
dist:
pip install setuptools wheel
python setup.py sdist bdist_wheel
test:
# Default options are configured in pytest.ini
# Skip jupyter tests, because they only work if the kernel is configured manually
python -m pytest -m "not jupyter"
test-fast:
python -m pytest -m "not slow and not jupyter and not stochastic"
test-slow:
python -m pytest -m slow
kernel:
# Setup a kernel for Jupyter with the name test-jupyter uses to find it
python -m ipykernel install --user --name="LEAP_venv"
test-jupyter:
# Won't work unless you have a 'LEAP_venv' kernel
python -m pytest -m jupyter
pep8:
# Check for PEP8 compliance in source directories
flake8 leap examples
clean:
cd docs && make clean
find . -name *.pyc -delete
find . -name __pycache__ -type d -exec rm -rf {} +
find . -name *.egg-info -type d -exec rm -rf {} +