-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (67 loc) · 2.98 KB
/
Copy pathMakefile
File metadata and controls
85 lines (67 loc) · 2.98 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
77
78
79
80
81
82
83
84
85
.PHONY: sync format lint typecheck test test-fast live live-mcp bc cov cov-mcp docs unasync unasync-check check build clean
# Install the project and the dev dependency group into a uv-managed venv.
sync:
uv sync
format:
uv run ruff format src tests
uv run ruff check --select I --fix src tests
lint:
uv run ruff check src tests
uv run ruff format --check src tests
typecheck:
uv run mypy
uv run basedpyright
# Full suite, parallelized across cores (xdist). Legacy-compat/BC tests included.
test:
uv run pytest -n auto
# Serial run (easier debugging / accurate tracebacks).
test-fast:
uv run pytest
# Opt-in live tests against the REAL API (needs VULNERS_API_KEY or
# tests/live.local.toml; skipped otherwise). Serial, to keep the SDK's per-key
# rate limiter coherent and subscription mutations ordered. The MCP live suite
# runs separately (live-mcp) because its `mcp` extra can't share this env.
live:
uv run pytest tests/live -m live --ignore=tests/live/test_live_mcp.py
# Live MCP-server tests in the isolated `mcp` extra env (fastmcp).
live-mcp:
uv run --no-default-groups --extra mcp --with pytest --with pytest-asyncio \
pytest tests/live/test_live_mcp.py -m live
# Backward-compatibility oracle only.
bc:
uv run pytest tests/bc -n auto
# Branch-coverage gate for the NEW v4 core (must stay at 100%; enforced by
# fail_under=100 in [tool.coverage.report]). Scope is config-driven: bare --cov
# measures the whole package per [tool.coverage.run] (source + omit), so any new
# module is inside the gate by default; only the legacy v3 layer is omitted.
cov:
uv run coverage erase
uv run pytest -n auto --cov
# Branch-coverage gate for the MCP server, which lives behind the `mcp` extra
# (fastmcp) and cannot share the default env, so it is measured on its own.
cov-mcp:
uv run --no-default-groups --extra mcp --with pytest --with pytest-asyncio --with pytest-cov \
pytest tests/test_mcp.py --cov=vulners._mcp --cov-config=tests/.coveragerc-mcp \
--cov-branch --cov-report=term-missing --cov-fail-under=100
# Same scope as `cov` ([tool.coverage.run] omits the legacy v3 layer), but
# informational only — not gated. Kept as the no-fail variant of the report.
cov-all:
uv run coverage erase
uv run pytest -n auto --cov --cov-fail-under=0
# Regenerate the sync mirror (_ratelimit.py + resources/_sync + transport client)
# from the async source. unasyncd lives in the isolated `codegen` group (it pulls
# msgspec, kept out of the default dev sync), so run it with just that group.
unasync:
uv run --no-default-groups --group codegen unasyncd
# Fail if the committed sync mirror has drifted from the async source.
unasync-check:
uv run --no-default-groups --group codegen unasyncd --check
# Strict docs build (fails on any warning, incl. unresolved mkdocstrings refs).
docs:
uv run --group docs mkdocs build --strict
check: lint typecheck unasync-check test
build:
uv build
clean:
rm -rf dist build .pytest_cache .ruff_cache .mypy_cache
find . -name '__pycache__' -type d -prune -exec rm -rf {} +