-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (44 loc) · 1.66 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
.PHONY: develop docs
PYTHON ?= python3
IN_VENV=. ./venv/bin/activate
venv/bin/activate:
test -d venv || $(PYTHON) -m venv venv
${IN_VENV} && pip install pip --upgrade
${IN_VENV} && pip install -r requirements.txt
develop: venv/bin/activate
${IN_VENV} && python setup.py develop
test: venv/bin/activate
${IN_VENV} && pip install flake8 flake8-rst-docstrings flake8-docstrings flake8-import-order pytest
# ${IN_VENV} && flake8 aplanat \
# --import-order-style google --application-import-names aplanat \
# --statistics
# demo should run without error
${IN_VENV} && python -m pytest
# ${IN_VENV} && python setup.py install
# ${IN_VENV} && aplanat demo
IN_BUILD=. ./pypi_build/bin/activate
pypi_build/bin/activate:
test -d pypi_build || $(PYTHON) -m venv pypi_build --prompt "(pypi) "
${IN_BUILD} && pip install pip --upgrade
${IN_BUILD} && pip install --upgrade pip setuptools twine wheel readme_renderer[md] keyrings.alt
.PHONY: sdist
sdist: pypi_build/bin/activate
${IN_BUILD} && python setup.py sdist
.PHONY: clean
clean:
rm -rf __pycache__ dist build venv aplanat.egg-info tmp docs/_build
# Documentation
SPHINXOPTS =
SPHINXBUILD = sphinx-build
BUILDDIR = _build
PAPER =
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
DOCSRC = docs
docs: venv/bin/activate
${IN_VENV} && pip install sphinx sphinx_rtd_theme sphinx-argparse
${IN_VENV} && cd $(DOCSRC) && $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(DOCSRC)/$(BUILDDIR)/html."
touch $(DOCSRC)/$(BUILDDIR)/html/.nojekyll