-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (34 loc) · 1.09 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
PYTHON ?= python3
.PHONY: docs html quality precommit coverage
package := explabox
check_dirs := $(package)
docs_dir := docs
build_dir := $(docs_dir)/build
source_dir := $(docs_dir)/source
# Build documentation files
docs:
cp img/$(package)-logo-text.png $(source_dir)/_static
sphinx-apidoc --module-first --no-toc --force --templatedir=$(source_dir)/_templates/ -o $(source_dir)/api explabox
cp CHANGELOG.md $(source_dir)/changelog.md
cp CONTRIBUTING.md $(source_dir)/contributing.md
cp INSTALLATION.md $(source_dir)/installation.md
cp EXAMPLE_USAGE.md $(source_dir)/example-usage.md
# Convert docs to HTML
html:
sphinx-build -M clean $(source_dir) $(build_dir)
sphinx-build -M html $(source_dir) $(build_dir)
# Check style quality
quality:
$(PYTHON) -m black --line-length=120 --check explabox
$(PYTHON) -m isort --line-length=120 --profile=black --check-only explabox
flake8 explabox --config .flake8
$(PYTHON) -m doc8 ./docs
check-manifest
# Fix styles and check security issues
precommit:
pre-commit run
# Coverage
coverage:
coverage run -m pytest
coverage html
open htmlcov/index.html