-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (56 loc) · 1.91 KB
/
Makefile
File metadata and controls
72 lines (56 loc) · 1.91 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
60
61
62
63
64
65
66
67
68
69
70
71
72
# Nabla ML Infrastructure Makefile
# Absolute path for the project root
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
# Virtual environment detection
VENV := $(ROOT_DIR)/venv
BIN := $(VENV)/bin
ifeq ($(OS),Windows_NT)
BIN := $(VENV)/Scripts
endif
# Check if venv exists, otherwise use global python
PYTHON := python3
ifneq ("$(wildcard $(BIN)/python*)","")
PYTHON := $(BIN)/python
endif
.PHONY: help test test-unit test-mojo lint format typecheck docs docs-serve clean install dev-install
help:
@echo "Nabla ML Development Commands:"
@echo " make install Install production dependencies"
@echo " make dev-install Install development dependencies and package in editable mode"
@echo " make test Run all tests"
@echo " make test-unit Run unit tests only"
@echo " make test-mojo Run Mojo-specific tests"
@echo " make lint Run ruff check"
@echo " make format Run ruff format"
@echo " make typecheck Run mypy type checking"
@echo " make docs Build Sphinx documentation"
@echo " make docs-serve Serve documentation locally on port 8000"
@echo " make clean Clean build artifacts and caches"
install:
$(PYTHON) -m pip install -r requirements.txt
dev-install:
$(PYTHON) -m pip install -r requirements-dev.txt
$(PYTHON) -m pip install -e ".[dev]"
test:
$(PYTHON) -m pytest tests/
test-unit:
$(PYTHON) -m pytest tests/unit/
test-mojo:
$(PYTHON) -m pytest tests/mojo/
lint:
$(PYTHON) -m ruff check nabla/ tests/
format:
$(PYTHON) -m ruff format nabla/ tests/
typecheck:
$(PYTHON) -m mypy nabla/
docs:
export PATH="$(BIN):$$PATH" && bash docs/build.sh
docs-serve:
$(PYTHON) -m http.server -d docs/_build/html 8000
clean:
rm -rf docs/_build/
rm -rf .pytest_cache/
rm -rf .ruff_cache/
rm -rf .mypy_cache/
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type d -name "*.egg-info" -exec rm -rf {} +