Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (59 loc) · 2.16 KB
/
Copy pathMakefile
File metadata and controls
84 lines (59 loc) · 2.16 KB
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
install:
pip install --upgrade pip && pip install -e .
uninstall:
pip uninstall dlomix -y
install-nodeps:
pip install --upgrade pip && pip install -e . --no-deps
install-dev:
pip install --upgrade pip && pip install -e .[dev]
.PHONY: test
test:
make uninstall
make install
mkdir -p .test_results/cov/
python -m pytest tests/ --junitxml=.test_results/junit/test-results.xml --cov=dlomix --cov-report html:.test_results/cov/cov_html --cov-report xml:.test_results/cov/cov.xml --cov-report lcov:.test_results/cov/cov.info --cov-report annotate:.test_results/cov/cov_annotate
test-local:
make uninstall
make install-nodeps
mkdir -p .test_results/cov/
python -m pytest tests/ --junitxml=.test_results/junit/test-results.xml --cov=dlomix --cov-report html:.test_results/cov/cov_html --cov-report xml:.test_results/cov/cov.xml --cov-report lcov:.test_results/cov/cov.info --cov-report annotate:.test_results/cov/cov_annotate
format:
black ./src/dlomix/*
isort --profile black .
black ./src/dlomix/*.py
black ./run_scripts/*.py
black ./tests/*.py
black ./scripts/*.py
format-check:
black --check ./src/dlomix ./run_scripts ./tests ./scripts
isort --profile black --check-only ./src/dlomix ./run_scripts ./tests ./scripts
lint:
pylint --disable=R,C ./src/dlomix/*
lint-errors-only:
pylint --errors-only --disable=R,C ./src/dlomix/*
# Documentation
BACKEND ?= tensorflow
DOCS_DIR := docs
BUILD_ROOT := $(DOCS_DIR)/_build
BUILD_DIR := $(BUILD_ROOT)/html/$(BACKEND)
build-docs-framework:
sphinx-apidoc -M -f -E -l -o $(DOCS_DIR)/ src/dlomix/
python $(DOCS_DIR)/codify_package_titles.py
DLOMIX_BACKEND=$(BACKEND) sphinx-build -b html $(DOCS_DIR)/ $(BUILD_DIR)
build-docs:
# Clean old builds
rm -rf $(BUILD_ROOT)/html
# Build TensorFlow
$(MAKE) build-docs-framework BACKEND=tensorflow
# Build PyTorch
$(MAKE) build-docs-framework BACKEND=pytorch
build-docs-local:
# Clean old builds
rm -rf $(BUILD_ROOT)/html
# Build TensorFlow
$(MAKE) build-docs-framework BACKEND=tensorflow
# Build PyTorch
$(MAKE) build-docs-framework BACKEND=pytorch
bash $(DOCS_DIR)/create_root_index_redirect.sh $(BUILD_ROOT)/html
open $(BUILD_ROOT)/html/index.html
all: install format test