-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
39 lines (32 loc) · 1.01 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
# install, test, and clean
PROJECT=gravmag
TESTDIR=$(PROJECT)/tests
help:
@echo "Commands:"
@echo ""
@echo " install install in editable mode"
@echo " test run the test suite (including doctests) and report coverage"
@echo " report open the html test report"
@echo " clean clean up build and generated files"
@echo " style automatically format code with black"
@echo " uninstall uninstall and remove from "
install:
# Install the python package
pip install --no-deps -e .
test:
# Run tests using coverage and pytest
mkdir -p $(TESTDIR)
cd $(TESTDIR); coverage run -m pytest; coverage html
report:
# Show test report produced by coverage
firefox $(TESTDIR)/htmlcov/index.html
clean:
find . -name "*.pyc" -exec rm -v {} \;
find . -name ".coverage" -exec rm -v {} \;
find . -name ".pytest_cache" -exec rm -rvf {} \;
find . -name "__pycache__" -exec rm -rvf {} \;
style:
python -m black --line-length 80 --verbose .
uninstall:
python -m pip uninstall $(PROJECT)
rm -rvf *.egg-info