-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
50 lines (37 loc) · 1.08 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
# simple makefile to simplify repetitive build env management tasks under posix
# CAREFUL: several commands are not compatible with Windows shell
VENV_BIN = .venv/bin
PYTHON = $(VENV_BIN)/python
PIP = $(VENV_BIN)/pip
PYTEST = $(VENV_BIN)/pytest
BLACK = $(VENV_BIN)/black
JUPYTER = $(VENV_BIN)/jupyter
HATCH = $(VENV_BIN)/hatch
FILENAME ?=
all: clean test format
clean-pyc:
find . -name "*.pyc" | xargs rm -f
find . -name "__pycache__" | xargs rm -rf
clean-build:
rm -rf build
clean: clean-build clean-pyc
generate-test-data:
$(PYTHON) ./biolearn/test/generate.py
jupyter:
mkdir -p notebooks
$(JUPYTER) lab
install:
$(PIP) install -e .[dev]
format:
$(BLACK) ./biolearn
check-format:
$(BLACK) --check ./biolearn
publish:
$(HATCH) build -c
$(HATCH) publish
test-code:
$(PYTEST) --pyargs biolearn --cov=biolearn $(if $(strip $(FILENAME)), -k $(FILENAME))
test-coverage:
rm -rf coverage .coverage
$(PYTEST) --pyargs biolearn --showlocals --cov=biolearn --cov-report=html:coverage
test: generate-test-data test-code