-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (40 loc) · 1.55 KB
/
Makefile
File metadata and controls
53 lines (40 loc) · 1.55 KB
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
PYTHON ?= python
PIP ?= $(PYTHON) -m pip
SRC_DIR := src
INPUT ?= data/raw/DoOR.data-2.0.0/data
OUTPUT ?= door_cache
.PHONY: help install install-dev extract validate lint format type-check test clean
help:
@echo "Usage: make <target>"
@echo
@echo "Targets:"
@echo " install Install runtime dependencies from requirements.txt"
@echo " install-dev Install runtime + developer dependencies (pip install -e .[dev])"
@echo " extract Run DoOR extraction (override INPUT=... OUTPUT=...)"
@echo " validate Validate an existing cache directory (override CACHE=...)"
@echo " lint Run flake8 against src/"
@echo " format Check formatting with black"
@echo " type-check Run mypy against src/"
@echo " test Execute pytest suite"
@echo " clean Remove build artifacts and coverage caches"
install:
$(PYTHON) -m pip install --upgrade pip
$(PIP) install -r requirements.txt
install-dev: install
$(PIP) install -e .[dev]
extract:
PYTHONPATH=$(SRC_DIR) $(PYTHON) -m door_toolkit.cli --input $(INPUT) --output $(OUTPUT)
CACHE ?= $(OUTPUT)
validate:
./scripts/validate-cache $(CACHE)
lint:
flake8 src/door_toolkit --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src/door_toolkit --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
format:
black --check src/door_toolkit
type-check:
mypy src/door_toolkit --ignore-missing-imports
test:
PYTHONPATH=$(SRC_DIR) pytest tests -v
clean:
rm -rf dist build *.egg-info .pytest_cache .mypy_cache coverage.xml htmlcov