-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmakefile
31 lines (28 loc) · 865 Bytes
/
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
BUILDDIR := $(PWD)
PYCHECKDIRS := src tests
PYCHECKGLOBS := 'src/**/*.py' 'tests/**/*.py' 'utils/**/*.py' setup.py
# run checks on all files for the repo
quality:
@echo "Running copyright checks";
python utils/copyright.py quality $(PYCHECKGLOBS)
@echo "Running python quality checks";
black --check $(PYCHECKDIRS);
isort --check-only $(PYCHECKDIRS);
flake8 $(PYCHECKDIRS);
# style the code according to accepted standards for the repo
style:
@echo "Running copyright style";
python utils/copyright.py style $(PYCHECKGLOBS)
@echo "Running python styling";
black $(PYCHECKDIRS);
isort $(PYCHECKDIRS);
# run tests for the repo
test:
@echo "Running python tests";
pytest tests;
# clean package
clean:
@echo "Cleaning up";
rm -rf .pytest_cache;
rm -rf src/sparsezoo.egg-info;
find $(PYCHECKDIRS) | grep -E "(__pycache__|\.pyc|\.pyo)" | xargs rm -rf;