-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (77 loc) · 3.07 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
ROOTDIR = $(shell pwd)
RUN = poetry run
VERSION = $(shell poetry -C src/restoration_ingests version -s)
### Help ###
define HELP
╭───────────────────────────────────────────────────────────╮
Makefile for restoration_ingests
│ ───────────────────────────────────────────────────────── │
│ Usage: │
│ make <target> │
│ │
│ Targets: │
│ help Print this help message │
│ │
│ all Install everything and test │
│ fresh Clean and install everything │
│ clean Clean up build artifacts │
│ clobber Clean up generated files │
│ │
│ install Poetry install package │
│ download Download data │
│ run Run the transform │
│ │
│ docs Generate documentation │
│ │
│ test Run all tests │
│ │
│ lint Lint all code │
│ format Format all code │
╰───────────────────────────────────────────────────────────╯
endef
export HELP
.PHONY: help
help:
@printf "$${HELP}"
### Installation and Setup ###
.PHONY: fresh
fresh: clean clobber all
.PHONY: all
all: install test
.PHONY: install
install:
poetry install --with dev
### Documentation ###
.PHONY: docs
docs:
$(RUN) mkdocs build
### Testing ###
.PHONY: test
test: download
$(RUN) pytest tests
### Running ###
.PHONY: download
download:
$(RUN) ingest download
.PHONY: run
run: download
$(RUN) ingest transform
$(RUN) python scripts/generate-report.py
### Linting, Formatting, and Cleaning ###
.PHONY: clean
clean:
rm -f `find . -type f -name '*.py[co]' `
rm -rf `find . -name __pycache__` \
.venv .ruff_cache .pytest_cache **/.ipynb_checkpoints
.PHONY: clobber
clobber:
# Add any files to remove here
@echo "Nothing to remove. Add files to remove to clobber target."
.PHONY: lint
lint:
$(RUN) ruff check --diff --exit-zero
$(RUN) black -l 120 --check --diff src tests
.PHONY: format
format:
$(RUN) ruff check --fix --exit-zero
$(RUN) black -l 120 src tests