-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
222 lines (206 loc) · 6.41 KB
/
pyproject.toml
File metadata and controls
222 lines (206 loc) · 6.41 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# Helix-TTD Python Toolkit Configuration
# Constitutional AI governance utilities
# License: Apache-2.0
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "helix-ttd-gemini"
version = "1.5.0"
authors = [
{name = "Stephen Hope", email = "sbhope@gmail.com"},
]
description = "Constitutional AI governance utilities for the Helix-TTD Federation"
readme = "README.md"
license = {text = "Apache-2.0"}
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
[project.scripts]
helix = "helix_code.helix_cli:main"
# ============================================================
# SETUPTOOLS: Package Discovery
# ============================================================
[tool.setuptools.packages.find]
where = ["."]
include = ["helix_code*", "helix_ttd_claw*"]
exclude = ["helix_code.tests*", "tools*", "docs*", "EVAC*", "*.tests*", "*.tests.*", "tests.*", "tests*"]
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"pytest-cov>=4.0",
"pytest-xdist>=3.0",
"black>=23.0",
"ruff>=0.1.0",
"mypy>=1.0",
"isort>=5.12",
]
# ============================================================
# RUFF: Constitutional Python Linting
# ============================================================
[tool.ruff]
target-version = "py310"
line-length = 100
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"N", # pep8-naming
"D", # pydocstyle
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
]
ignore = [
# Docstring ignores (temporary for v1.4.0 release)
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the first line
"D415", # First line should end with punctuation
# Style ignores
"E501", # Line too long (handled by formatter)
"E712", # Comparison to True/False (common in tests)
"E402", # Module level import not at top (sys.path manipulation)
"W291", # Trailing whitespace
"W293", # Blank line contains whitespace
"F841", # Unused variable
"B905", # zip without strict=
"N818", # Exception name suffix Error
# Simplification ignores
"SIM102", # Nested if statements
"SIM108", # Ternary operator
"SIM110", # Use all() instead of for loop
"SIM118", # Use key in dict instead of dict.keys()
"B007", # Unused loop control variable
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"helix_code/tests/*" = ["D", "S"]
"tools/*" = ["D100"]
# ============================================================
# BLACK: Sovereign Code Formatting
# ============================================================
[tool.black]
line-length = 100
target-version = ['py310', 'py311', 'py312']
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
)/
'''
# ============================================================
# ISORT: Import Ordering
# ============================================================
[tool.isort]
profile = "black"
line_length = 100
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
# ============================================================
# MYPY: Epistemic Type Checking
# ============================================================
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = false
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
# ============================================================
# PYTEST: Verification Framework
# ============================================================
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["helix_code/tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--strict-markers",
"--strict-config",
"--verbose",
"--tb=short",
]
markers = [
"constitutional: Tests constitutional compliance",
"epistemic: Tests epistemic labeling",
"federation: Tests federation integration",
"slow: Marks tests as slow (deselect with '-m \"not slow\"')",
]
[tool.coverage.run]
source = ["helix_code"]
omit = [
"helix_code/tests/*",
"helix_code/setup.py",
# CLI tools not in production deployment
"helix_code/helix_cli.py",
"helix_code/federation_cli.py",
"helix_code/gcp_integrations.py",
"helix_code/helix-ttd-claw-agent.py",
"helix_code/openclaw_agent.py",
"helix_code/naming_convention.py",
"helix_code/helix_ttd_claw/**/*",
# Stub files for federation testing
"helix_code/stub_*.py",
# Tools directory
"helix_code/tools/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
]
show_missing = true
fail_under = 75.0
# ============================================================
# BANDIT: Security Scanning
# ============================================================
[tool.bandit]
exclude_dirs = ["helix_code/tests", "tools", ".venv", "venv", ".git", ".mypy_cache", ".ruff_cache"]
skips = [
"B101", # assert_used (common in tests)
"B311", # random (cryptographic use only in tests)
]
severity = "medium"
confidence = "medium"
# Note: B105 (hardcoded_password) and B106 (hardcoded_password_funcarg)
# are flagged in test files but safe for test fixtures