-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (46 loc) · 1.71 KB
/
Makefile
File metadata and controls
59 lines (46 loc) · 1.71 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
# Build, package, test, and clean
PROJECT=choclo
CHECK_STYLE=src/$(PROJECT) doc test
GITHUB_ACTIONS=.github/workflows
PYTEST_ARGS=--verbose --doctest-modules
PYTEST_COV_ARGS=--cov-report=term-missing --cov $(PYTEST_ARGS)
.PHONY: build install test test-coverage test-numba format check check-format check_style check-actions clean
help:
@echo "Commands:"
@echo ""
@echo " install install in editable mode"
@echo " test run the test suite (including doctests) and report coverage"
@echo " format automatically format the code"
@echo " check run code style and quality checks"
@echo " build build source and wheel distributions"
@echo " clean clean up build and generated files"
@echo ""
build:
python -m build .
install:
python -m pip install --no-deps --editable .
test: test-numba test-coverage
test-coverage:
NUMBA_DISABLE_JIT=1 pytest $(PYTEST_COV_ARGS) test src/$(PROJECT)
test-numba:
NUMBA_DISABLE_JIT=0 pytest $(PYTEST_ARGS) test src/$(PROJECT)
format:
ruff check --select I --fix $(CHECK_STYLE) # fix isort errors
ruff format $(CHECK_STYLE)
burocrata --extension=py $(CHECK_STYLE)
check: check-format check-style check-actions
check-format:
ruff format --check $(CHECK_STYLE)
burocrata --check --extension=py $(CHECK_STYLE)
check-style:
ruff check $(CHECK_STYLE)
check-actions:
zizmor $(GITHUB_ACTIONS)
clean:
find . -name "*.pyc" -exec rm -v "{}" \;
find . -name "*.orig" -exec rm -v "{}" \;
find . -name ".coverage.*" -exec rm -v "{}" \;
find . -name "_version.py" -exec rm -v "{}" \;
find . -name "*.egg-info" -type d -exec rm -vr "{}" \; -prune
find . -name "__pycache__" -type d -exec rm -vr "{}" \; -prune
rm -rvf build dist MANIFEST .coverage .cache .pytest_cache