-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
152 lines (145 loc) · 6.34 KB
/
Copy pathpyproject.toml
File metadata and controls
152 lines (145 loc) · 6.34 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
[project]
name = "ai-rig"
version = "0"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
# Dev-only tooling (PEP 735). Not project dependencies. uv used in CI; locally use plain python/pytest.
[dependency-groups]
dev = [
{ include-group = "docs" },
{ include-group = "test" },
]
# Test tooling + benchmark runtime deps (benchmark tests import the run-codemap scripts).
test = [
"pytest",
"pytest-cov",
# "pytest-randomly",
"pytest-rerunfailures",
"pytest-timeout",
"pytest-xdist",
"scipy",
{ include-group = "bench" },
]
# MkDocs site build (source of truth; used by the docs workflow).
docs = [
"mkdocs-callouts>=1.13",
"mkdocs-git-revision-date-localized-plugin>=1.2",
"mkdocs-material[imaging]>=9.5",
"pymdown-extensions>=10.21.2",
]
# Benchmark runtime deps (source of truth; run: uv sync --only-group bench).
bench = [
"anthropic>=0.40",
"fire>=0.6",
"pandas>=2",
"rich>=13",
"semble>=0.1",
"tabulate>=0.9",
"tiktoken>=0.7",
]
# No runtime dependencies — this repo ships Claude Code plugins, not a package.
[tool.uv]
package = false # env anchor only; never build/install the root as a package
[tool.ruff]
line-length = 120
extend-exclude = [
".experiments/", # Jupytext notebook scripts — IPython builtins (get_ipython, display) not in scope
"plugins/codemap-py/tests/data/corpus/", # frozen-grammar fixtures — intentional post-3.11 syntax, parse-errors under py310 target
"site/", # MkDocs build output — generated, not source
]
format = {}
# Complexity gate — enforced for codemap-py only (the negated pattern below ignores the
# rules everywhere else). The other plugins carry their own, much larger, backlog of
# complexity findings; gating them is a separate decision.
lint.extend-select = [ "C901", "D401", "D402", "D403", "PLR0911", "PLR0912", "PLR0915", "W505" ]
# Accepted debt, frozen at today's offender set: the gate exists to stop NEW complexity
# entering the plugin, not to force a refactor of the scanner and graph internals. Each
# entry is a ceiling, never a licence — a function added to one of these files that
# exceeds the limits still needs splitting, it just is not machine-enforced here.
# Re-measure with `ruff check --select C901,PLR0911,PLR0912,PLR0915` after touching them.
lint.per-file-ignores."!plugins/codemap-py/**" = [ "C901", "PLR0911", "PLR0912", "PLR0915" ]
# 1 PLR0911 each
lint.per-file-ignores."plugins/codemap-py/bin/resolve_index_env.py" = [ "PLR0911" ]
lint.per-file-ignores."plugins/codemap-py/src/codemap_py/cli.py" = [ "PLR0911" ]
# 1 C901 (_recompute_metrics, 22) + 3 PLR
lint.per-file-ignores."plugins/codemap-py/src/codemap_py/graph.py" = [ "C901", "PLR0911", "PLR0912", "PLR0915" ]
# 5 C901 (worst: _drop_top_level_rebindings, 30) + 8 PLR
lint.per-file-ignores."plugins/codemap-py/src/codemap_py/scanner.py" = [ "C901", "PLR0911", "PLR0912", "PLR0915" ]
lint.per-file-ignores."plugins/codemap-py/src/codemap_py/schema.py" = [ "PLR0911" ]
lint.per-file-ignores."plugins/codemap-py/tests/data/parity_golden/_schema.py" = [ "PLR0911" ]
lint.mccabe.max-complexity = 12
lint.pycodestyle.max-doc-length = 120
lint.pylint = { max-returns = 6, max-branches = 12, max-statements = 50 }
[tool.codespell]
# ignore-words-list: real words/tokens codespell misflags — "derails" (not "details"),
# "fo" (Windows tasklist's real /FO format flag, not a typo for "for"/"of")
ignore-words-list = "derails,fo"
skip = "./site,./.git" # MkDocs build output + git internals — generated, not source
[tool.docformatter]
black = true
wrap-summaries = 120
wrap-descriptions = 120
[tool.pytest]
ini_options.testpaths = [ "benchmarks", "plugins", "tests" ]
# benchmarks/ has no __init__.py by design; this puts it on sys.path so suites import
# `_bench_common.<mod>` directly, with no `benchmarks.`-prefixed namespace-package fallback.
ini_options.pythonpath = [ "benchmarks" ]
ini_options.norecursedirs = [
"*.egg",
".*",
"build",
"dist",
"node_modules",
"site",
]
ini_options.addopts = [
"--strict-markers",
"--import-mode=importlib",
"--color=yes",
"--doctest-modules",
"--cov=plugins/codemap-py/bin",
"--cov=plugins/codemap-py/src",
"--cov=plugins/cc_develop/bin",
"--cov=plugins/cc_foundry/bin",
"--cov=plugins/cc_oss/bin",
"--cov=plugins/cc_research/bin",
"--cov-report=term-missing",
"--cov-report=html:.reports/coverage",
"--ignore=benchmarks/results",
# A hung test otherwise burns the job's whole 25-minute budget and names nothing;
# this fails the single offender instead. Slowest legitimate test measured 64 s on a
# 16-core dev box, and CI runners are slower, so the cap keeps ~3x headroom rather
# than trading a hang for flaky timeouts. timeout_method is left at the default
# (SIGALRM where available, thread on Windows) so POSIX legs fail one test and keep
# going, rather than tearing down the whole session.
"--timeout=180",
]
ini_options.markers = [
# No checkout-only metadata, tooling, or fixtures; excludes the outer build/install harness.
# Independent of packaging: an installed-plugin runtime test need not test packaging.
"installed_plugin: runs against an installed plugin without repository context",
# Mocked subprocess/service calls alone do not qualify. Live tests also carry integration.
"integration: exercises interactions between real components or processes",
# Requires explicit opt-in guards; selection never authorizes network or paid execution.
# Excludes offline, fixture, dry-run, and mocked calls.
"live: uses real external services, user credentials, or provider budget",
# Covers build outputs, manifests, payload integrity, installation, and migration.
# May require repository context; does not imply installed_plugin.
"packaging: validates plugin build and distribution contracts",
]
ini_options.filterwarnings = [
"ignore::coverage.exceptions.CoverageWarning",
]
[tool.codemap]
# Bare dir names prune at walk time; path globs only filter after descending
# (scanner._iter_python_files, scanner._detect_src_root_from_init).
exclude = [
"results", # benchmarks/results/** — per-run snapshot copies of the plugin tree, 42160 .py duplicates
]