-
Notifications
You must be signed in to change notification settings - Fork 169
/
Makefile
51 lines (43 loc) · 1.38 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
.DEFAULT_GOAL := help
.PHONY: install-dev
install-dev: ## Install development dependencies.
@echo "Installing development dependencies..."
@python -m pip install ".[dev, onnxruntime]"
@pre-commit install
.PHONY: lint
lint: ## Check code with linters using pre-commit.
@echo "Running linters..."
@pre-commit run --all-files
.PHONY: test
test: ## Run unit tests using pytest.
@echo "Running tests..."
@pytest --exitfirst --verbose --failed-first --cov=.
.PHONY: build
build: ## Build the package for PyPI.
@echo "Building for PyPI..."
@python -m pip install --upgrade build
@python -m build
.PHONY: publish
publish: ## Publish to PyPI.
@echo "Publishing to PyPI..."
@python -m pip install --upgrade twine
@python -m twine upload --repository llm-guard dist/*
.PHONY: docs-serve
docs-serve: ## Serve documentation using mkdocs.
@echo "Serving documentation..."
@mkdocs serve -a localhost:8085
.PHONY: clean
clean: ## Clean and Remove build files and pytest cache.
@echo "Cleaning up..."
@rm -rf build dist .pytest_cache .egg-info llm_guard.egg-info
.PHONY: help
help: ## List all targets and help information.
@echo "Available commands:"
@grep --no-filename -E '^([a-z.A-Z_%-/]+:.*?)##' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?(## ?)"}; { \
if (length($$1) > 0) { \
printf " \033[36m%-30s\033[0m %s\n", $$1, $$2; \
} else { \
printf "%s\n", $$2; \
} \
}'