forked from polygraf-ai/Guardrails
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (42 loc) · 1.87 KB
/
Makefile
File metadata and controls
58 lines (42 loc) · 1.87 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
.PHONY: all test tests test_watch test_coverage test_profile docs docs-serve docs-update-cards docs-check-cards docs-watch-cards pre_commit help
# Default target executed when no specific target is provided to make.
all: help
# Define a variable for the test file path.
TEST_FILE ?= tests/
test:
poetry run pytest $(TEST_FILE)
tests:
poetry run pytest $(TEST_FILE)
test_watch:
poetry run ptw --snapshot-update --now . -- -vv $(TEST_FILE)
test_coverage:
poetry run pytest --cov=$(TEST_FILE) --cov-report=term-missing
test_profile:
poetry run pytest -vv tests/ --profile-svg
docs:
poetry run sphinx-build -b html docs _build/docs
docs-serve:
cd docs && poetry run sphinx-autobuild . _build/html --port 8000 --open-browser
docs-update-cards:
cd docs && poetry run python scripts/update_cards/update_cards.py
docs-check-cards:
cd docs && poetry run python scripts/update_cards/update_cards.py --dry-run
docs-watch-cards:
cd docs && poetry run python scripts/update_cards/update_cards.py watch
pre_commit:
pre-commit install
pre-commit run --all-files
# HELP
help:
@echo '----'
@echo 'test - run unit tests'
@echo 'tests - run unit tests'
@echo 'test TEST_FILE=<test_file> - run all tests in given file'
@echo 'test_watch - run unit tests in watch mode'
@echo 'test_coverage - run unit tests with coverage'
@echo 'docs - build docs, if you installed the docs dependencies'
@echo 'docs-serve - serve docs locally with auto-rebuild on changes'
@echo 'docs-update-cards - update grid cards in index files from linked pages'
@echo 'docs-check-cards - check if grid cards are up to date (dry run)'
@echo 'docs-watch-cards - watch for file changes and auto-update cards'
@echo 'pre_commit - run pre-commit hooks'