-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
258 lines (233 loc) · 6.53 KB
/
pyproject.toml
File metadata and controls
258 lines (233 loc) · 6.53 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "lexecon"
version = "0.1.0"
description = "A unified cryptographic governance system for AI safety, compliance, and auditability"
readme = "README.md"
authors = [
{ name = "Lexicoding Systems", email = "contact@lexicodinglabs.com" }
]
license = { text = "MIT" }
requires-python = ">=3.9"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Security",
"Topic :: Software Development :: Libraries :: Python Modules",
]
keywords = ["ai-safety", "governance", "cryptography", "compliance", "audit"]
dependencies = [
"fastapi>=0.109.0",
"uvicorn[standard]>=0.27.0",
"pydantic>=2.5.0",
"cryptography>=42.0.0",
"click>=8.1.0",
"pyyaml>=6.0",
"requests>=2.31.0",
"prometheus-client>=0.19.0",
"sentry-sdk>=2.51.0",
"redis>=7.0.1",
"pyjwt>=2.11.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-asyncio>=0.21.0",
"black>=23.12.0",
"flake8>=7.0.0",
"mypy>=1.8.0",
"isort>=5.13.0",
"ruff>=0.1.14",
"httpx>=0.27.0",
"pre-commit>=3.6.0",
"bandit[toml]>=1.7.6",
"pip-audit>=2.6.0",
"interrogate>=1.5.0",
]
docs = [
"sphinx>=7.2.0",
"sphinx-rtd-theme>=2.0.0",
]
features = [
"launchdarkly-server-sdk>=9.0.0",
]
observability = [
"opentelemetry-api>=1.20.0",
"opentelemetry-sdk>=1.20.0",
"opentelemetry-instrumentation-fastapi>=0.41b0",
"opentelemetry-exporter-jaeger>=1.20.0",
"prometheus-client>=0.19.0",
]
performance = [
"locust>=2.20.0", # Load testing
"orjson>=3.9.0", # Fast JSON serialization
"redis>=5.0.0", # Redis client for distributed caching (optional)
]
[project.urls]
Homepage = "https://github.com/Lexicoding-systems/Lexecon"
Documentation = "https://lexecon.readthedocs.io"
Repository = "https://github.com/Lexicoding-systems/Lexecon"
Issues = "https://github.com/Lexicoding-systems/Lexecon/issues"
[project.scripts]
lexecon = "lexecon.cli.main:cli"
[tool.setuptools.packages.find]
where = ["src", "."]
include = ["lexecon*", "model_governance_pack*"]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --cov=lexecon --cov-report=term-missing"
[tool.black]
line-length = 100
target-version = ["py39", "py310", "py311", "py312"]
include = '\.pyi?$'
[tool.isort]
profile = "black"
line_length = 100
[tool.mypy]
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
line-length = 120
# Assume Python 3.9
target-version = "py39"
[tool.ruff.lint]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"N", # pep8-naming
"D", # pydocstyle
"UP", # pyupgrade
"YTT", # flake8-2020
"ANN", # flake8-annotations
"S", # flake8-bandit
"BLE", # flake8-blind-except
"FBT", # flake8-boolean-trap
"B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"EM", # flake8-errmsg
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"T20", # flake8-print
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SLF", # flake8-self
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"ERA", # eradicate
"PL", # Pylint
"TRY", # tryceratops
"RUF", # Ruff-specific rules
]
ignore = [
"D203", # one-blank-line-before-class (conflicts with D211)
"D213", # multi-line-summary-second-line (conflicts with D212)
"D415", # First line should end with punctuation
"T201", # print statements (allow for CLI tools)
"EM101", # Exception string literals
"EM102", # Exception f-string literals
"TRY003", # Long exception messages
"FBT001", # Boolean positional argument
"FBT002", # Boolean default positional argument
"FBT003", # Boolean positional value in function call
"PLC0415", # Import not at top-level (allow for conditional imports)
"ANN201", # Missing return type annotation
"ANN204", # Missing return type annotation for __init__
"ANN001", # Missing type annotation for function argument
"SLF001", # Private member accessed
"B904", # Use raise from within except
"BLE001", # Do not catch blind exception
"DTZ003", # Use datetime.now(tz=...)
"PLR2004", # Magic value used in comparison
"E501", # Line too long
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # Use of assert detected
"ANN", # Type annotations
"D", # Docstrings
"PLR2004", # Magic value comparison
]
"__init__.py" = ["F401"] # Unused imports
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pylint]
max-args = 10
max-branches = 15
max-returns = 8
max-statements = 60
[tool.bandit]
exclude_dirs = ["tests", "venv", ".venv"]
skips = ["B101", "B601"] # Skip assert and shell injection for dev
[tool.interrogate]
ignore-init-method = true
ignore-init-module = true
ignore-magic = false
ignore-semiprivate = false
ignore-private = false
ignore-property-decorators = false
ignore-module = false
ignore-nested-functions = false
ignore-nested-classes = true
fail-under = 80
exclude = ["setup.py", "docs", "build", "tests"]
verbose = 1
quiet = false
whitelist-regex = []
color = true