-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (49 loc) · 1.67 KB
/
Makefile
File metadata and controls
59 lines (49 loc) · 1.67 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
54
55
56
57
58
59
# Magpie Makefile
# ========================
.PHONY: help venv install-dev install lint format test clean verify
PYTHON ?= python3
VENV_DIR ?= .venv
PIP := $(VENV_DIR)/bin/pip
PYTHON_VENV := $(VENV_DIR)/bin/python
help:
@echo "Magpie - GPU Kernel Evaluation Framework"
@echo ""
@echo "Setup:"
@echo " make venv - Create virtual environment"
@echo " make install - Install runtime deps (requirements.txt)"
@echo " make install-dev - Install dev deps (requirements + lint/test tools)"
@echo ""
@echo "Dev:"
@echo " make format - Format code (black + isort)"
@echo " make lint - Lint (ruff + mypy)"
@echo " make test - Run tests (pytest)"
@echo " make verify - Smoke check imports / CLI"
@echo " make clean - Remove build + cache artifacts"
venv:
$(PYTHON) -m venv $(VENV_DIR)
$(PIP) install --upgrade pip setuptools wheel
@echo "Virtualenv ready: source $(VENV_DIR)/bin/activate"
install: venv
$(PIP) install -r requirements.txt
# Prefer: requirements-dev.txt OR extras [dev]
install-dev: install
@if [ -f requirements-dev.txt ]; then \
$(PIP) install -r requirements-dev.txt ; \
else \
$(PIP) install pytest pytest-cov black isort mypy ruff ; \
fi
lint:
$(PYTHON_VENV) -m ruff check Magpie/
format:
$(PYTHON_VENV) -m ruff format Magpie/
test:
$(PYTHON_VENV) -m pytest -q
verify: venv
$(PYTHON_VENV) -c "import Magpie; print('Import OK')"
$(PYTHON_VENV) -m Magpie --help >/dev/null 2>&1 || true
@echo "Verify done."
clean:
rm -rf .venv __pycache__ .pytest_cache .mypy_cache .ruff_cache
rm -rf *.egg-info build dist results/
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete