-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
67 lines (55 loc) · 1.67 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
PYTHON3 := $(shell which python3 2>/dev/null)
PYTHON := python3
COVERAGE := --cov=xcc --cov-report term-missing --cov-report=html:coverage_html_report
TESTRUNNER := -m pytest tests
.PHONY: help
help:
@echo "Please use \`make <target>\` where <target> is one of"
@echo " install to install XCC"
@echo " wheel to build the XCC wheel"
@echo " dist to package the source distribution"
@echo " docs to generate the Sphinx documentation"
@echo " lint to lint the Python source files"
@echo " format to format the Python source files"
@echo " clean to delete all temporary, cache, and build files"
@echo " clean-docs to delete all generated documentation"
@echo " test to run the test suite"
@echo " coverage to generate a coverage report"
.PHONY: install
install:
ifndef PYTHON3
@echo "To install the XCC you need to have Python 3 installed"
endif
$(PYTHON) -m pip install -e .
.PHONY: lint
lint:
$(PYTHON) -m pylint xcc tests/*.py
.PHONY: format
format:
$(PYTHON) -m black --check --diff --color xcc tests
$(PYTHON) -m isort --check --diff --color --profile black xcc tests
.PHONY: wheel
wheel:
$(PYTHON) -m build --no-isolation --wheel
.PHONY: dist
dist:
$(PYTHON) -m build --no-isolation --sdist
.PHONY : clean
clean:
rm -rf build
rm -rf dist
rm -rf tests/__pycache__
rm -rf xcc/__pycache__
rm -rf xcc/interfaces/__pycache__
.PHONY : docs
docs:
make -C docs html
.PHONY : clean-docs
clean-docs:
rm -rf docs/api
make -C docs clean
test:
$(PYTHON) $(TESTRUNNER)
coverage:
@echo "Generating coverage report..."
$(PYTHON) $(TESTRUNNER) $(COVERAGE)