-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (54 loc) · 2.38 KB
/
Makefile
File metadata and controls
76 lines (54 loc) · 2.38 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
73
74
75
76
TEST_FILTER ?= .
# Make it simpler to change args during `uv run` calls.
UV_RUN ?= uv run
venv: ## Make a virtualenv
uv venv
install: ## Install only production dependencies
uv pip install --editable .[all]
install-dev: ## Install production with development dependencies
uv pip install --editable .[all,dev]
docs-build: ## Build the static docs ./site directory
$(UV_RUN) mkdocs build
docs-serve: ## Serve the documentation dev site
$(UV_RUN) mkdocs serve
test: ## Run tests via pytest, optionally filtering (Ex.: `make test TEST_FILTER=map-xids`)
$(UV_RUN) pytest -p no:nbmake -k '$(TEST_FILTER)'
test-nb: install ## Test all notebooks, optionally specifying file (Ex: `make test-nb NB_FILTER=map-xids`)
$(UV_RUN) pytest -p no:cov --nbmake docs/notebooks/*$(NB_FILTER)*.ipynb
test-cov: ## Run tests via pytest (with coverage report)
$(UV_RUN) pytest --cov=reddwarf --cov-report term-missing:skip-covered
cov-report-html: ## Build and open html coverage report
$(UV_RUN) pytest --cov=reddwarf --cov-report html
open htmlcov/index.html
test-debug: ## Run tests via pytest, optionally filtering (with verbose debugging)
# Make sure stdout is rendered to screen.
# Show full diffs on failure.
$(UV_RUN) pytest -p no:nbmake --capture=no -vv -k '$(TEST_FILTER)'
test-cram: ## Run cram snapshot tests
$(UV_RUN) cram tests/cram/*.t
test-cram-update: ## Update cram snapshot tests (interactive)
$(UV_RUN) cram -i tests/cram/*.t
test-all: test test-nb test-cram docs-build ## Run unit, notebook, and cram tests
# Small hint to remove gitignore'd python version file, which can confuse usage of uv.
clean:
rm .python-version
clear-test-cache: ## Cleak the SQLite database of cached HTTP requests
rm -f test_cache.sqlite
download: install ## Download Polis data into fixtures dir (Ex: `make download CONVO_ID=7vampckwrh DIR=example`)
$(UV_RUN) scripts/download_sample_data.py $(CONVO_ID) $(DIR)
release: ## Print no-op documentation to guide the release process
$(UV_RUN) scripts/release.py
build: ## Build a wheel for upload to PyPI
rm -rf dist/
uv build
# These make tasks allow the default help text to work properly.
%:
@true
.PHONY: help
help:
@echo 'Usage: make <command>'
@echo
@echo 'where <command> is one of the following:'
@echo
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help