-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
45 lines (33 loc) · 1.12 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
.PHONY: build clean release doc-upgrade doc-html doc-clean doc-reset
PYTHON = python3
TWINE = twine
# readthedocs.org uses Python 3.7
DOCPYTHONVERSION=3.7
DOCPYTHON = python3.7
DOCDIR = $(realpath docs)
DOCVENVDIR = $(DOCDIR)/.venv
DOCVENVPYTHON = $(DOCVENVDIR)/bin/python3
DOCSPHINXBUILD = $(DOCVENVDIR)/bin/sphinx-build
DOCPIPCOMPILE = $(DOCVENVDIR)/bin/pip-compile
DOCPIPSYNC = $(DOCVENVDIR)/bin/pip-sync
build:
$(PYTHON) setup.py sdist bdist_wheel
clean:
rm -rf dist
release: clean build
$(TWINE) upload -s -i [email protected] dist/*
doc-upgrade: $(DOCPIPCOMPILE)
cd $(DOCDIR) && $(DOCPIPCOMPILE) -r --resolver=backtracking requirements.in
doc-html: $(DOCSPHINXBUILD)
$(DOCVENVPYTHON) -m pip install -e $(PWD)
$(MAKE) -C $(DOCDIR) SPHINXBUILD=$(DOCSPHINXBUILD) html
doc-clean: $(DOCSPHINXBUILD)
$(MAKE) -C $(DOCDIR) SPHINXBUILD=$(DOCSPHINXBUILD) clean
doc-reset:
rm -rf "$(DOCVENVDIR)"
$(DOCSPHINXBUILD): $(DOCPIPSYNC)
cd $(DOCDIR) && $(DOCPIPSYNC) --python-executable $(DOCVENVPYTHON)
$(DOCPIPSYNC):
$(DOCPYTHON) -m venv $(DOCVENVDIR)
$(DOCVENVPYTHON) -m pip install -U pip pip-tools
$(DOCPIPCOMPILE): $(DOCPIPSYNC)