-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (36 loc) · 1.1 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
# Build mass
# J. Fowler, NIST
# Updated May 2023
TARGET_ZIP = mass.zip
TARGET_TAR = mass.tgz
PYSCRIPTS = bin/hdf5print bin/ljh_merge bin/ljh_truncate
PYFILES = $(shell find . -name "*.py") $(PYSCRIPTS)
CYFILES = $(shell find . -name "*.pyx")
FORMFILES := $(shell find mass -name "*_form_ui.py")
.PHONY: all build clean clean_hdf5 test pep8 autopep8 lint ruff
all: build test
build:
python -m build
clean: clean_hdf5
rm -rf build || sudo rm -rf build
rm -f `find . -name "*.pyc"`
clean_hdf5:
rm -f */regression_test/*_mass.hdf5
test: clean_hdf5
pytest
archive: $(TARGET_ZIP)
$(TARGET_ZIP): $(PYFILES) $(CYFILES) Makefile
python setup.py sdist --format=gztar,zip
.PHONY: autopep8 pep8 lint
PEPFILES := $(PYFILES) # Don't pep8 the $(CYFILES)
PEPFILES := $(filter-out $(FORMFILES), $(PEPFILES)) # Remove the UI.py forms
pep8: pep8-report.txt
pep8-report.txt: $(PEPFILES) Makefile
pycodestyle --exclude=build,nonstandard . > $@ || true
autopep8: $(PEPFILES) Makefile
autopep8 --verbose --in-place --recursive .
lint: lint-report.txt
lint-report.txt: $(PYFILES) Makefile
ruff check > $@
ruff:
ruff check