-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
74 lines (58 loc) · 1.47 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
68
69
70
71
72
73
74
help:
@echo "The following targets are available:"
@echo
@echo "docs:"
@echo " build the HTML documentation"
@echo
@echo "docs-{html,clean,...}:"
@echo " run the corresponding make target in the docs directory"
@echo
@echo "test:"
@echo " run the test suite"
@echo
@echo "formatting:"
@echo " check source code formatting"
@echo
@echo "reformat:"
@echo " reformat source code"
@echo
@echo "lint:"
@echo " check code style"
@echo
@echo "typecheck:"
@echo " run static type checker"
@echo
@echo "dev-install:"
@echo " install the package in development mode including dev dependencies"
@echo
ifneq ($(wildcard Makefile.conf),)
include Makefile.conf
endif
O ?=
PYTHON ?= python3
SPHINXBUILD ?= $(PYTHON) -m sphinx-build
.PHONY: help docs test formatting reformat lint fix
.PHONY: typecheck typecheck-pyright typecheck-mypy ci
docs: docs-html
docs-%:
$(MAKE) -C docs $*
test:
$(PYTHON) -m pytest \
--cov-report html --cov-report xml:.coverage.xml --cov-report term \
--cov yosys_mau \
-n auto -q $(O)
formatting:
$(PYTHON) -m black --check --diff src tests $(O)
reformat:
$(PYTHON) -m black src tests $(O)
lint:
$(PYTHON) -m ruff check src tests $(O)
fix:
$(PYTHON) -m ruff check --fix src tests $(O)
typecheck:
$(PYTHON) -m pyright src tests $(O)
dev-install:
$(PYTHON) -m pip install -e '.[dev]' $(O)
ci: formatting lint typecheck test docs-html
clean: docs-clean
rm -rf .coverage .pytest_cache .mypy_cache .ruff_cache htmlcov .coverage.xml