-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
202 lines (185 loc) · 6.24 KB
/
Copy pathpyproject.toml
File metadata and controls
202 lines (185 loc) · 6.24 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
[project]
name = "Deriva"
version = "0.7.0"
description = "Deriva is a research project aimed at enabling digital architects by automating the derivation of enterprise architecture models. Deriva uses dual knowledge graphs, heuristics and LLM's."
readme = "README.md"
requires-python = ">=3.14"
authors = [
{ name = "S. T. Grond", email = "steven@deriva.dev" }
]
license = { text = "AGPL-3.0" }
keywords = [
"archimate",
"enterprise-architecture",
"code-analysis",
"llm",
"grafeo",
"marimo",
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Documentation",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Scientific/Engineering :: Information Analysis",
"Typing :: Typed",
]
dependencies = [
# Core
"pydantic>=2.12",
"pydantic-settings>=2.13",
"python-dotenv>=1.2",
"pyyaml>=6.0",
"rich>=14.3",
"lxml>=6.0",
# Databases
"duckdb>=1.5",
"grafeo>=0.5",
"sqlglot>=29",
# UI
"marimo>=0.20",
"anywidget-graph>=0.2",
# Code Analysis (tree-sitter)
"tree-sitter>=0.24.6",
"tree-sitter-python>=0.23.0",
"tree-sitter-javascript>=0.23.0",
"tree-sitter-java>=0.23.0",
"tree-sitter-c-sharp>=0.23.0",
# Document Parsing
"pypdf>=6.8",
"python-docx>=1.2",
# Graph Algorithms
"solvor>=0.6",
# LLM
"backoff>=2.2.1",
"pydantic-ai>=1",
# Utilities
"authlib>=1.6.9", # CVE-2026-27962, CVE-2026-28490 fix (transitive via fastmcp)
"pyasn1>=0.6.3", # CVE-2026-30922 fix (transitive via google-auth/rsa)
"pyjwt>=2.12", # CVE-2026-32597 fix (transitive via mcp)
"diskcache>=5.6.3",
"nest-asyncio>=1.6.0",
"structlog>=24.0",
"typer>=0.24",
"prek>=0.3",
]
[project.optional-dependencies]
dev = [
"pip-audit>=2",
"pytest>=9.0",
"pytest-cov>=7",
"ruff>=0.15",
"ty>=0.0",
"types-lxml>=2026.2",
]
[project.urls]
Homepage = "https://deriva.dev"
Documentation = "https://deriva.dev/docs"
Repository = "https://github.com/StevenBtw/deriva"
Issues = "https://github.com/StevenBtw/deriva/issues"
Changelog = "https://github.com/StevenBtw/deriva/blob/main/CHANGELOG.md"
[project.scripts]
deriva-cli = "deriva.cli.cli:main"
deriva-app = "deriva.app.app:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["deriva"]
# ============================================================================
# Tool Configuration
# ============================================================================
[tool.ruff]
line-length = 180
target-version = "py314"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"FA", # flake8-future-annotations
"Q", # flake8-quotes
"TID251", # banned-api - architectural boundary enforcement
]
ignore = [
"E402", # Module level import not at top - needed for conditional imports
]
[tool.ruff.lint.flake8-quotes]
inline-quotes = "double"
docstring-quotes = "double"
# =============================================================================
# Architectural Boundaries (Enforced by Ruff TID251)
# =============================================================================
# Layer hierarchy (top to bottom):
# CLI → can import: services ONLY (PipelineSession is the API)
# App → can import: services ONLY (PipelineSession is the API)
# Services → can import: adapters, modules, common
# Adapters → can import: common only (NOT modules or services)
# Modules → can import: common only (NOT adapters or services)
# Common → can import: stdlib and third-party only
#
# Per-layer restrictions are defined in:
# - deriva/cli/ruff.toml
# - deriva/common/ruff.toml
# - deriva/adapters/ruff.toml
# - deriva/modules/ruff.toml
# =============================================================================
[tool.ruff.lint.flake8-tidy-imports.banned-api]
# CLI should never be imported by any layer (it's a top-level entry point)
"deriva.cli" = { msg = "Architecture violation: cli is a top-level entry point and should not be imported" }
# Note: Layer-specific bans (adapters↔modules, etc.) are in per-directory ruff.toml files
[tool.ruff.lint.per-file-ignores]
# Tests can import from any layer for testing purposes
"tests/**/*.py" = ["E402", "TID251"]
# Marimo app: allow long lines for UI code
"deriva/app/app.py" = ["E501"]
# Files with long strings (SQL, LLM prompts)
"deriva/modules/validation/__init__.py" = ["E402"]
"deriva/modules/derivation/__init__.py" = ["E402"]
"deriva/adapters/database/export_current_db.py" = ["E501"]
"deriva/modules/extraction/*.py" = ["E501"]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["."]
addopts = "-v -m 'not integration'"
markers = [
"integration: integration tests (run locally with -m integration)",
]
[tool.coverage.run]
source = ["deriva/adapters", "deriva/modules", "deriva/common", "deriva/services", "deriva/cli"]
omit = [
"*/__init__.py",
"*/tests/*",
# Marimo app (interactive UI, not unit testable)
"deriva/app/*",
# Graph database adapters
"deriva/adapters/grafeo/*",
"deriva/adapters/graph/*",
"deriva/adapters/database/*",
"deriva/adapters/archimate/*",
# Refine steps requiring graph infrastructure
"deriva/modules/derivation/refine/graph_relationships.py",
# Benchmarking service (requires LLMs/databases for full testing)
"deriva/services/benchmarking.py",
# Analysis modules (cross-repo, semantic matching) - require full pipeline integration
"deriva/services/analysis.py",
"deriva/modules/analysis/cross_repo_analysis.py",
"deriva/modules/analysis/semantic_matching.py",
]
[tool.coverage.report]
fail_under = 80
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"raise NotImplementedError",
]
[tool.ty.environment]
python-version = "3.14"