-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
231 lines (212 loc) · 6.61 KB
/
pyproject.toml
File metadata and controls
231 lines (212 loc) · 6.61 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
[project]
name = "napari-mcp"
dynamic = ["version"]
description = "MCP server for remote control of napari viewers via Model Context Protocol"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "BSD-3-Clause" }
authors = [{ name = "Ilan Theodoro", email = "ilan.silva@czbiohub.org" }]
maintainers = [{ name = "Ilan Theodoro", email = "ilan.silva@czbiohub.org" }]
keywords = ["napari", "mcp", "microscopy", "image-analysis", "ai", "claude"]
classifiers = [
"Development Status :: 3 - Alpha",
"Framework :: napari",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Image Processing",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"fastmcp>=2.10.3",
"napari>=0.5.5",
"qtpy>=2.4.1",
"Pillow>=10.3.0",
"imageio>=2.34.0",
"numpy>=1.26.0",
"typer>=0.9.0",
"rich>=13.0.0",
"toml>=0.10.2",
'tomli>=2.0; python_version < "3.11"',
]
[project.urls]
Homepage = "https://github.com/royerlab/napari-mcp"
Repository = "https://github.com/royerlab/napari-mcp"
Documentation = "https://royerlab.github.io/napari-mcp/"
"Bug Tracker" = "https://github.com/royerlab/napari-mcp/issues"
[project.optional-dependencies]
dev = [
"ruff>=0.12.10",
"mypy>=1.17.0",
"types-toml>=0.10.8.20240310",
"types-Pillow>=10.0.0",
"pre-commit>=4.3.0",
"bandit>=1.8.6",
]
all = ["napari-mcp[dev]"]
[project.scripts]
napari-mcp = "napari_mcp.server:main"
napari-mcp-install = "napari_mcp.cli.main:app"
[project.entry-points."napari.manifest"]
napari-mcp = "napari_mcp:napari.yaml"
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8.0", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
napari_mcp = ["napari.yaml"]
[tool.setuptools_scm]
write_to = "src/napari_mcp/_version.py"
fallback_version = "0.0.1"
version_scheme = "guess-next-dev"
local_scheme = "node-and-date"
# Accept SemVer tags, including pre-release/build metadata (e.g., v1.2.3, v1.2.3-alpha.1, 1.2.3+build)
tag_regex = "^(?P<prefix>v)?(?P<version>\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?)$"
[tool.pytest.ini_options]
addopts = [
"-q",
"-p napari",
"--strict-markers",
"--tb=short",
"--cov-config=.coveragerc",
"-p no:cacheprovider", # Disable cache for better isolation
]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"realgui: marks tests that require a real napari GUI session (deselect with -m 'not realgui')",
"slow: marks tests as slow (deselect with -m 'not slow')",
"integration: marks integration tests",
"unit: marks unit tests",
"smoke: marks smoke tests for quick validation",
"isolated: marks tests that must run in complete isolation",
"benchmark: marks performance benchmark tests",
]
filterwarnings = [
"ignore::DeprecationWarning:napari.*",
"ignore::DeprecationWarning:vispy.*",
"ignore::DeprecationWarning:qtpy.*",
"ignore::PendingDeprecationWarning:napari.*",
]
# Test isolation settings
junit_family = "xunit2"
[tool.ruff]
line-length = 88
target-version = "py310"
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".mypy_cache",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"*vendored*",
"*_vendor*",
"*_version.py",
]
fix = true
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"Q", # flake8-quotes
"S", # bandit
"D", # pydocstyle
"BLE", # flake8-blind-exception
"A", # flake8-builtins
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PIE", # flake8-pie
]
ignore = [
"E501", # line too long - handled by ruff format
"BLE001", # blind except - needed for robust error handling in server code
"S101", # assert detected - allow in tests
"S110", # try-except-pass - acceptable for best-effort operations
"SIM105", # contextlib.suppress - prefer explicit try/except for clarity
"TCH003", # typing-only imports - not critical for functionality
"D401", # imperative mood - not critical for functionality
"E402", # module import not at top - needed for conditional imports
"UP006", # type annotation - magicgui requires runtime type annotation
"UP007", # type annotation - magicgui requires runtime type annotation
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"S101",
"S106",
"S311",
"D",
] # Allow asserts, hardcoded passwords, random, and skip docstrings in tests
"src/napari_mcp/server.py" = ["S102", "S307", "A002"] # exec/eval needed for MCP execute_code; format param
"src/napari_mcp/bridge_server.py" = ["S102", "S307"] # exec/eval needed for MCP execute_code
"src/napari_mcp/_helpers.py" = ["S102", "S307"] # exec/eval needed for run_code helper
"src/napari_mcp/cli/install/utils.py" = ["S603", "S607"] # subprocess needed for python detection
"src/napari_mcp/cli/install/codex_cli.py" = ["S603", "S607"] # subprocess needed for codex
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[dependency-groups]
dev = [
"ruff>=0.12.10",
"types-toml>=0.10.8.20240310",
]
testing = [
"pytest>=8.4.0",
"pytest-asyncio>=0.23.0",
"pytest-cov>=4.0.0",
"pytest-qt>=4.0.0",
"pytest-xdist>=3.5.0",
"pytest-timeout>=2.2.0",
"pytest-benchmark>=4.0.0",
"pytest-mock>=3.12.0",
"pytest-random-order>=1.1.0",
"pytest-forked>=1.6.0",
"hypothesis>=6.100.0",
"napari[testing,pyqt6]",
]
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["osx-arm64"]
[tool.pixi.pypi-dependencies]
napari-mcp = { path = ".", editable = true }
[tool.pixi.environments]
default = { solve-group = "default" }
all = { features = ["all", "dev", "testing"], solve-group = "default" }
dev = { features = ["dev"], solve-group = "default" }
testing = { features = ["testing"], solve-group = "default" }
[tool.pixi.tasks]