-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
236 lines (210 loc) · 7.63 KB
/
Copy pathpyproject.toml
File metadata and controls
236 lines (210 loc) · 7.63 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "chemigram"
version = "1.11.0"
description = "Agent-driven photo editing on darktable, via MCP."
readme = "README.md"
requires-python = ">=3.11"
license = { text = "MIT" }
authors = [
{ name = "Marko Mrdjenovic" },
]
keywords = ["darktable", "photography", "mcp", "agentic", "raw-processing"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Multimedia :: Graphics",
]
# Runtime dependencies. Kept minimal per BYOA (ADR-007) and dt-orchestration-only
# (ADR-014). defusedxml for safely parsing dtstyle and XMP files (untrusted XML
# from contributor packs); exifread for L1 vocabulary auto-binding via camera+
# lens identity (Slice 1, RFC-015 → ADR-053; pure-Python, no native deps);
# Jinja2 for the prompt system (Slice 3); MCP for the agent protocol (Slice 3).
# Pillow may join when mask manipulation arrives in Slice 4.
dependencies = [
"mcp>=1.27",
"defusedxml>=0.7",
"exifread>=3.0",
"Jinja2>=3.1",
# Pillow lands here for the `compare` MCP tool's side-by-side stitch.
# Pure infrastructure (image reading/writing/composition) — does not
# violate BYOA (ADR-007) or dt-orchestration-only (ADR-014). When Slice 4
# adds the masking pipeline, Pillow gets reused for raster mask handling.
"Pillow>=10.0",
# Typer for the CLI adapter (RFC-020 / ADR-070; v1.3.0+). Brings Click +
# Rich transitively. CLI is a thin wrapper over chemigram.core, mirroring
# the MCP tool surface verb-for-verb (ADR-071). uv.lock pins exact
# versions for CI reproducibility — no need for an upper bound here.
"typer>=0.12",
"rawpy>=0.27.0",
]
[project.optional-dependencies]
dev = [
# Test framework (ADR-036)
"pytest>=8.0",
"pytest-cov>=5.0",
# Lint + format (ADR-037)
"ruff>=0.6",
# Type checking (ADR-038)
"mypy>=1.10",
# Pre-commit (ADR-039)
"pre-commit>=3.7",
# Build tooling (ADR-042)
"build>=1.2",
"twine>=5.0",
]
# Docs site (MkDocs + Material). Pure-Python toolchain; matches the
# project's "no Node.js" stance. Build via `make docs-build`; serve
# with live reload via `make docs-serve`. Deployed to GitHub Pages
# by .github/workflows/docs.yml on every push to main.
docs = [
"mkdocs>=1.6",
"mkdocs-material>=9.5",
"mkdocstrings[python]>=0.26",
"mkdocs-awesome-pages-plugin>=2.9",
]
[project.scripts]
chemigram-mcp = "chemigram.mcp.server:main"
chemigram = "chemigram.cli.main:app"
[project.urls]
Homepage = "https://github.com/chipi/chemigram"
Repository = "https://github.com/chipi/chemigram"
Issues = "https://github.com/chipi/chemigram/issues"
# ---------------------------------------------------------------------------
# Hatchling build config (ADR-034, ADR-049)
# ---------------------------------------------------------------------------
[tool.hatch.build.targets.wheel]
packages = ["src/chemigram"]
# Include the starter vocabulary (per ADR-049) as package data so
# `pip install chemigram` ships with a working starter pack out of the box.
[tool.hatch.build.targets.wheel.force-include]
"vocabulary/starter" = "chemigram/_starter_vocabulary"
[tool.hatch.build.targets.sdist]
include = [
"src/",
"vocabulary/",
"README.md",
"LICENSE",
"CHANGELOG.md",
"pyproject.toml",
]
# ---------------------------------------------------------------------------
# Ruff (ADR-037) — lint + format in one tool
# ---------------------------------------------------------------------------
[tool.ruff]
line-length = 100
target-version = "py311"
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"S", # flake8-bandit (security)
"C90", # mccabe complexity
"RUF", # ruff-specific rules
]
ignore = [
"S101", # assert used (fine in tests)
"S603", # subprocess call without shell=True (we want this; darktable-cli)
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "S105", "S106"]
# Color-math conventions follow CIE notation: uppercase L (lightness), C
# (chroma), T (term), S (lightness factor), G/R/RT (gain/rotation terms).
# Renaming would obscure the algorithm.
"src/chemigram/core/assertions.py" = ["N802", "N803", "N806"]
"tests/fixtures/reference-targets/generate_synthetic.py" = ["N802", "N803", "N806"]
# apply_primitive routes 4 distinct mask paths (raster+ref, drawn+spec,
# mask_override-rejected, no-mask) plus error mapping per path. The
# branches are flat and named; splitting hurts readability more than it
# helps. v1.4.0 follow-up: ADR-074 / drawn-mask binding.
"src/chemigram/cli/commands/edit.py" = ["C901"]
"src/chemigram/mcp/tools/vocab_edit.py" = ["C901"]
"tests/integration/test_reference_synthetic.py" = ["N802", "N803", "N806"]
"tests/unit/core/test_assertions.py" = ["N802", "N803", "N806"]
# Typer's API is built on `typer.Option(...)` and `typer.Argument(...)` as
# argument defaults — that's the canonical idiom (RFC-020 / ADR-070).
# B008 fires false-positive on every CLI command function.
"src/chemigram/cli/main.py" = ["B008"]
"src/chemigram/cli/commands/*.py" = ["B008"]
# The CLI reference HEADER table contains long markdown rows; line-length
# rules don't help readability for tabular data.
"scripts/generate-cli-reference.py" = ["E501"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
# ---------------------------------------------------------------------------
# Mypy (ADR-038) — strict on chemigram.core, looser elsewhere
# ---------------------------------------------------------------------------
[tool.mypy]
python_version = "3.11"
strict = false
warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
[[tool.mypy.overrides]]
module = "chemigram.core.*"
strict = true
[[tool.mypy.overrides]]
module = ["chemigram.mcp.*", "tests.*"]
strict = false
warn_return_any = false
disallow_untyped_defs = false
# CLI is a thin wrapper using Typer; Typer's decorators are untyped at
# the wrapped-function level, so disallow_untyped_decorators must be off.
[[tool.mypy.overrides]]
module = "chemigram.cli.*"
strict = false
warn_return_any = false
disallow_untyped_defs = false
disallow_untyped_decorators = false
# Third-party libraries that may not have stubs
[[tool.mypy.overrides]]
module = ["mcp.*", "defusedxml.*"]
ignore_missing_imports = true
# ---------------------------------------------------------------------------
# Pytest (ADR-036) — three tiers
# ---------------------------------------------------------------------------
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"-q",
]
markers = [
"unit: pure-logic tests, no I/O, no subprocess (fast)",
"integration: tests using real .dtstyle files in temp filesystem (no darktable required)",
"e2e: end-to-end tests that invoke darktable-cli (require darktable installed)",
]
[tool.coverage.run]
source = ["src/chemigram"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[dependency-groups]
dev = [
"hypothesis>=6.152.9",
]