forked from RaoFoundation/subtensor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
65 lines (50 loc) · 2.11 KB
/
Copy pathjustfile
File metadata and controls
65 lines (50 loc) · 2.11 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
# Development commands. Everything runs through uv against the locked env.
# Fast feedback: lint, typecheck, unit tests.
default: check
# Install/refresh the dev environment from the lockfile.
sync:
uv sync --locked --all-extras --dev
# All offline gates, same as CI.
check: lint typecheck test codegen-static
lint:
uv run ruff check .
uv run ruff format --check .
fmt:
uv run ruff check . --fix
uv run ruff format .
# Error-level diagnostics fail; pre-existing warnings are the ratchet
# (see [tool.ty.rules] in pyproject.toml).
typecheck:
uv run ty check --exit-zero-on-warning bittensor
# Offline unit tests.
test *ARGS:
uv run pytest {{ARGS}}
cov:
uv run pytest --cov --cov-report=term
# Registry gates that need no chain: every call wrapped-or-raw-only, every
# classified error name still exists, hyperparameter units agree with the
# storage value type identities the metadata carries, and the namespaces.pyi
# stub matches the read registry.
codegen-static:
uv run python -m codegen.check --coverage
uv run python -m codegen.check --names
uv run python -m codegen.check --units
uv run python -m codegen.check --namespaces
# Regenerate bittensor/namespaces.pyi from the read registry (no node needed).
regen-namespaces:
uv run python -m codegen.emit_namespaces
# --- targets that need a running node (default ws://127.0.0.1:9944) ---
# Regenerate bittensor/_generated from a node's metadata and re-record the
# golden fixture. Run after a runtime upgrade, then commit both.
regen endpoint="ws://127.0.0.1:9944":
uv run python -m codegen {{endpoint}}
uv run python scripts/record_golden.py {{endpoint}}
# Regenerate docs reference pages from SDK registries (requires uv sync first).
regen-docs:
uv run python ../../website/apps/bittensor-website/scripts/generate.py
# Fail if committed docs pages are stale vs SDK registries.
check-docs:
uv run python ../../website/apps/bittensor-website/scripts/generate.py --check
# Committed _generated/ must match the node's metadata.
drift endpoint="ws://127.0.0.1:9944":
uv run python -m codegen.check --drift {{endpoint}}