-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathMakefile
87 lines (61 loc) · 2.91 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
PYTHON_EXECUTABLE ?= python3
.PHONY: doc
all: clean src wheel
clean:
$(PYTHON_EXECUTABLE) setup.py clean
rm -rf dist build *.egg-info
doc: notebooks flake8
rm -rf build/sphinx doc/build .hypothesis
$(PYTHON_EXECUTABLE) -m sphinx -b html doc build/sphinx/html
view_doc:
x-www-browser build/sphinx/html/index.html
doc_autobuild: clean notebooks
$(PYTHON_EXECUTABLE) -m sphinx_autobuild --open-browser --delay 0 --watch coax --ignore *.tfevents.* -b html doc build/sphinx/html
sync: intersphinx get_pylintrc
intersphinx:
mkdir -p doc/_intersphinx
wget -O doc/_intersphinx/python3.inv https://docs.python.org/3/objects.inv
wget -O doc/_intersphinx/numpy.inv https://numpy.org/doc/stable/objects.inv
wget -O doc/_intersphinx/sklearn.inv https://scikit-learn.org/stable/objects.inv
wget -O doc/_intersphinx/jax.inv https://jax.readthedocs.io/en/latest/objects.inv
wget -O doc/_intersphinx/haiku.inv https://dm-haiku.readthedocs.io/en/latest/objects.inv
wget -O doc/_intersphinx/spinup.inv https://spinningup.openai.com/en/latest/objects.inv
$(PYTHON_EXECUTABLE) -m sphinx.ext.intersphinx doc/_intersphinx/python3.inv > doc/_intersphinx/python3.txt
$(PYTHON_EXECUTABLE) -m sphinx.ext.intersphinx doc/_intersphinx/numpy.inv > doc/_intersphinx/numpy.txt
$(PYTHON_EXECUTABLE) -m sphinx.ext.intersphinx doc/_intersphinx/sklearn.inv > doc/_intersphinx/sklearn.txt
$(PYTHON_EXECUTABLE) -m sphinx.ext.intersphinx doc/_intersphinx/jax.inv > doc/_intersphinx/jax.txt
$(PYTHON_EXECUTABLE) -m sphinx.ext.intersphinx doc/_intersphinx/haiku.inv > doc/_intersphinx/haiku.txt
$(PYTHON_EXECUTABLE) -m sphinx.ext.intersphinx doc/_intersphinx/spinup.inv > doc/_intersphinx/spinup.txt
get_pylintrc:
wget -O .pylintrc https://raw.githubusercontent.com/google/jax/master/pylintrc
src:
$(PYTHON_EXECUTABLE) setup.py sdist
wheel:
$(PYTHON_EXECUTABLE) setup.py bdist_wheel
install:
$(PYTHON_EXECUTABLE) -m pip install .
upload: all
$(PYTHON_EXECUTABLE) -m twine upload dist/*
pylint:
$(PYTHON_EXECUTABLE) -m pylint --rcfile=.pylintrc coax
flake8:
$(PYTHON_EXECUTABLE) -m flake8 coax
test_all: test_gpu test_cpu
test: flake8 # for quick testing
JAX_PLATFORM_NAME=cpu $(PYTHON_EXECUTABLE) -m pytest --numprocesses auto coax -v -x --ff
test_cpu: flake8
JAX_PLATFORM_NAME=cpu $(PYTHON_EXECUTABLE) -m pytest coax -v -x --ff
test_gpu: flake8
JAX_PLATFORM_NAME=gpu $(PYTHON_EXECUTABLE) -m pytest coax -v -x --ff
notebooks:
$(PYTHON_EXECUTABLE) ./doc/create_notebooks.py
install_dev: install_requirements
$(PYTHON_EXECUTABLE) -m pip install -e .
install_requirements: __install_requirements intersphinx
upgrade_requirements: __upgrade_requirements install_requirements
__install_requirements:
for r in requirements.txt requirements.dev.txt requirements.doc.txt ; do $(PYTHON_EXECUTABLE) -m pip install -r $$r ; done
__upgrade_requirements:
$(PYTHON_EXECUTABLE) upgrade_requirements.py
rm_pycache:
find -regex '.*__pycache__[^/]*' -type d -exec rm -rf '{}' \;