-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (42 loc) · 1.81 KB
/
Makefile
File metadata and controls
56 lines (42 loc) · 1.81 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
# Build, package, test, and clean
PROJECT=harmonica
STYLE_CHECK_FILES=src/$(PROJECT) test doc
GITHUB_ACTIONS=.github/workflows
.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 run ruff to automatically format the code"
@echo " check run code style and quality checks (ruff and burocrata)"
@echo " build build source and wheel distributions"
@echo " clean clean up build and generated files"
@echo ""
.PHONY: build, install, test, test_coverage, test_numba, format, check, check-format, check-style, check-actions, clean
build:
python -m build .
install:
python -m pip install --no-deps -e .
test: test_coverage test_numba
test_coverage:
NUMBA_DISABLE_JIT=1 MPLBACKEND='agg' pytest --verbose --cov --cov-config="pyproject.toml" --doctest-modules --doctest-continue-on-failure src/$(PROJECT) test
test_numba:
NUMBA_DISABLE_JIT=0 MPLBACKEND='agg' pytest --verbose --doctest-modules --doctest-continue-on-failure -m use_numba src/$(PROJECT) test
format:
ruff check --select I --fix $(STYLE_CHECK_FILES) # fix isort errors
ruff format $(STYLE_CHECK_FILES)
burocrata --extension=py $(STYLE_CHECK_FILES)
check: check-format check-style check-actions
check-format:
ruff format --check $(STYLE_CHECK_FILES)
burocrata --check --extension=py $(STYLE_CHECK_FILES)
check-style:
ruff check $(STYLE_CHECK_FILES)
check-actions:
zizmor $(GITHUB_ACTIONS)
clean:
find . -name "*.pyc" -exec rm -v {} \;
find . -name ".coverage.*" -exec rm -v {} \;
rm -rvf build dist MANIFEST *.egg-info __pycache__ .coverage .cache .pytest_cache $(PROJECT)/_version.py
rm -rvf dask-worker-space