-
Notifications
You must be signed in to change notification settings - Fork 709
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (40 loc) · 1.72 KB
/
Makefile
File metadata and controls
52 lines (40 loc) · 1.72 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
.PHONY: all pre-commit mypy test test-cov-html test-cov-xml
CMD:=uv run -m
PYMODULE:=pyrit
TESTS:=tests
UNIT_TESTS:=tests/unit
INTEGRATION_TESTS:=tests/integration
END_TO_END_TESTS:=tests/end_to_end
all: pre-commit
pre-commit:
$(CMD) isort --multi-line 3 --recursive $(PYMODULE) $(TESTS)
pre-commit run --all-files
mypy:
$(CMD) mypy $(PYMODULE) $(UNIT_TESTS)
# Build the full documentation site:
# 1. Generate API reference JSON from Python source (griffe)
# 2. Convert API JSON to MyST markdown pages
# 3. Build the Jupyter Book site
# 4. Generate RSS feed
docs-build:
uv run python build_scripts/pydoc2json.py pyrit --submodules -o doc/_api/pyrit_all.json
uv run python build_scripts/gen_api_md.py
cd doc && uv run jupyter-book build --all --html
uv run ./build_scripts/generate_rss.py
# Regenerate only the API reference pages (without building the full site)
docs-api:
uv run python build_scripts/pydoc2json.py pyrit --submodules -o doc/_api/pyrit_all.json
uv run python build_scripts/gen_api_md.py
# Because of import time, "auto" seemed to actually go slower than just using 4 processes
unit-test:
$(CMD) pytest -n 4 --dist=loadfile --cov=$(PYMODULE) $(UNIT_TESTS)
unit-test-cov-html:
$(CMD) pytest -n 4 --dist=loadfile --cov=$(PYMODULE) $(UNIT_TESTS) --cov-report html
unit-test-cov-xml:
$(CMD) pytest -n 4 --dist=loadfile --cov=$(PYMODULE) $(UNIT_TESTS) --cov-report xml --junitxml=junit/test-results.xml --doctest-modules
integration-test:
$(CMD) pytest $(INTEGRATION_TESTS) --cov=$(PYMODULE) $(INTEGRATION_TESTS) --cov-report xml --junitxml=junit/test-results.xml --doctest-modules
end-to-end-test:
$(CMD) pytest $(END_TO_END_TESTS) -v --junitxml=junit/test-results.xml
#clean:
# git clean -Xdf # Delete all files in .gitignore