Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
380 lines (352 loc) · 11.5 KB
/
Copy pathpyproject.toml
File metadata and controls
380 lines (352 loc) · 11.5 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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
[build-system]
requires = ["hatchling", "hatch-fancy-pypi-readme>=24"]
build-backend = "hatchling.build"
[project]
name = "solidworks-mcp-python"
version = "2.1.0"
description = "Python MCP server for SolidWorks: lets Claude and other AI agents build parts, assemblies and drawings through the SolidWorks COM API."
# The README with relative links made absolute for PyPI: see the fancy-pypi-readme hook.
dynamic = ["readme"]
requires-python = ">=3.13"
license = "MIT"
authors = [
{ name = "Andrew Bartels" },
]
maintainers = [
{ name = "Andrew Bartels" },
]
keywords = ["solidworks", "mcp", "model-context-protocol", "mcp-server", "cad", "cad-automation", "solidworks-api", "pywin32", "claude", "ai-agents"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Software Distribution",
]
dependencies = [
"fastmcp>=3.2.2",
"mcp>=1.28.1",
"pydantic>=2.5.0",
"pydantic-ai-slim[openai,anthropic,mcp]>=1.107.4,<2",
"sqlmodel>=0.0.22",
"chardet<6",
"pywin32>=306; platform_system=='Windows'",
"pywin32-ctypes>=0.2.0; platform_system=='Windows'",
"loguru>=0.7.0",
"typing-extensions>=4.8.0",
"httpx>=0.24.0",
"uvicorn>=0.24.0",
"python-dotenv>=1.0.0",
"jinja2>=3.1.0",
"sqlalchemy>=2.0.0",
"aiosqlite>=0.19.0",
"urllib3>=2.7.0",
"charset-normalizer>=3.4.0",
"typer>=0.12.0",
"rich>=13.0.0",
"pyasn1>=0.6.4",
"defusedxml>=0.7.1", # parses .sldmat material libraries safely
]
[project.optional-dependencies]
dev = [
# Testing framework
"pytest>=7.4.0",
"hatch-fancy-pypi-readme>=24", # renders the PyPI description in tests
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.11.0",
"pytest-timeout>=2.1.0",
"pytest-xdist>=3.3.0",
"pytest-benchmark>=4.0.0",
"numpy>=1.26.0",
"pypdfium2>=4.30.0", # live demos render each exported PDF into a frame
# Code quality and linting
"coverage[toml]>=7.3.0",
"mypy>=1.6.0",
"types-PyYAML>=6.0", # stubs mypy needs (make typecheck)
"types-defusedxml>=0.7",
"ruff>=0.1.0",
"black>=23.9.0",
# Documentation validation
"pydocstyle>=6.3.0", # Google style docstring validation
"doc8>=1.1.0", # Documentation linting
"sphinx>=7.0.0", # API documentation generation
"sphinx-autodoc-typehints>=1.24.0",
# Development workflow
"pre-commit>=3.4.0",
"tox>=4.11.0",
"factory-boy>=3.3.0",
"build>=1.0.0", # `python -m build`, used by `make build`
"pyyaml>=6.0", # solidworks_mcp.doc_links reads mkdocs.yml
]
test = [
"pytest>=7.4.0",
"hatch-fancy-pypi-readme>=24", # renders the PyPI description in tests
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.11.0",
"pytest-timeout>=2.1.0",
"pytest-xdist>=3.3.0",
"coverage[toml]>=7.3.0",
"fastapi>=0.115.0",
"numpy>=1.26.0",
"pypdfium2>=4.30.0", # live demos render each exported PDF into a frame
"pyyaml>=6.0", # solidworks_mcp.doc_links reads mkdocs.yml
]
docs = [
# <2: MkDocs 2 is announced to drop support for existing themes, plugins
# and configs (#46); stay on 1.x until the ecosystem moves.
"mkdocs>=1.5.0,<2",
"mkdocs-material>=9.4.0",
"mkdocs-awesome-pages-plugin>=2.9.0",
"mkdocs-mermaid2-plugin>=1.1.0",
"mkdocs-include-markdown-plugin>=6.0.0",
"mkdocstrings[python]>=0.24.0",
"mkdocs-gen-files>=0.5.0",
"mkdocs-literate-nav>=0.6.0",
"mkdocs-section-index>=0.3.0",
"mkdocs-autorefs>=0.5.0",
"mkdocs-minify-plugin>=0.7.0",
"mike>=2.0.0", # For versioning
"pygments>=2.16.0", # For syntax highlighting
]
ui = [
"fastapi>=0.115.0",
]
vision = [
"pillow>=10.0.0",
"scikit-image>=0.23.0",
"numpy>=1.26.0",
]
rag = [
"faiss-cpu>=1.7.0",
"sentence-transformers>=2.7.0",
"numpy>=1.26.0",
]
[project.urls]
"Homepage" = "https://github.com/andrewbartels1/SolidworksMCP-python"
"Documentation" = "https://andrewbartels1.com/SolidworksMCP-python/"
"Bug Reports" = "https://github.com/andrewbartels1/SolidworksMCP-python/issues"
"Source" = "https://github.com/andrewbartels1/SolidworksMCP-python"
"Changelog" = "https://github.com/andrewbartels1/SolidworksMCP-python/blob/main/CHANGELOG.md"
[project.scripts]
solidworks-mcp = "solidworks_mcp.server:cli_main"
# Same entry point under the package name, so `uvx solidworks-mcp-python` works.
solidworks-mcp-python = "solidworks_mcp.server:cli_main"
[tool.uv]
# Force resolution past known CVEs flagged by Trivy against uv.lock. Most of
# these are transitive (not declared directly by this project):
# - CVE-2026-84381 (httpcore2 < 2.10.0), CVE-2026-84382 (httpx2 < 2.12.0)
# - CVE-2026-63374 (anyio < 4.14.2)
# - CVE-2026-104851 (fsspec < 2026.6.0)
# - CVE-2026-107295 (pydantic-ai/-slim < 1.107.4) - held on 1.x; 2.x is a
# separate migration
# - CVE-2026-102266..102273 (pyjwt < 2.14.0)
# - CVE-2026-97687, CVE-2026-97689 (urllib3 < 2.8.0)
# - CVE-2026-102925, -102930, -102937, -113722, -113725 (virtualenv < 21.14.9).
# Needs packaging>=26.3, which is why the project depends on
# pydantic-ai-slim with only the extras it uses: full pydantic-ai pulls in
# xai-sdk, which pins packaging<26.
constraint-dependencies = [
"httpx2>=2.12.0",
"httpcore2>=2.12.0",
"anyio>=4.14.2",
"fsspec>=2026.6.0",
"pydantic-ai>=1.107.4,<2",
"pydantic-ai-slim>=1.107.4,<2",
"pyjwt>=2.14.0",
"urllib3>=2.8.0",
"virtualenv>=21.14.9",
]
[tool.hatch.build.targets.wheel]
packages = ["src/solidworks_mcp"]
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
"/docs",
"/examples",
"/README.md",
"/LICENSE",
"/pyproject.toml",
]
# The demo GIFs are 28 MB; the PyPI page loads them from GitHub instead.
exclude = ["/docs/assets"]
# PyPI shows the README without the repo around it, so relative paths would
# be broken images and dead links there. The README itself stays relative.
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "README.md"
# Images: <img src="docs/..."> and  load the raw file.
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
pattern = 'src="(?!https?://|#)([^"]+)"'
replacement = 'src="https://raw.githubusercontent.com/andrewbartels1/SolidworksMCP-python/main/\g<1>"'
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
pattern = '(!\[[^\]]*\])\((?!https?://|#)([^)\s]+)\)'
replacement = '\g<1>(https://raw.githubusercontent.com/andrewbartels1/SolidworksMCP-python/main/\g<2>)'
# Every other relative link opens the file on GitHub. Runs after the image
# rules, so images are already absolute and are skipped.
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
pattern = '\]\((?!https?://|#|mailto:)([^)\s]+)\)'
replacement = '](https://github.com/andrewbartels1/SolidworksMCP-python/blob/main/\g<1>)'
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
pattern = 'href="(?!https?://|#|mailto:)([^"]+)"'
replacement = 'href="https://github.com/andrewbartels1/SolidworksMCP-python/blob/main/\g<1>"'
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
norecursedirs = ["tests/solidworks_mcp/coverage", ".venv", ".git", "build", "dist"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--verbose",
"--tb=short",
"--strict-markers",
"--strict-config",
"--color=yes",
"--durations=10",
"--cov=src/solidworks_mcp",
"--cov-report=html:htmlcov",
"--cov-report=term-missing",
"--cov-report=xml",
"--cov-fail-under=90",
"--asyncio-mode=auto",
]
markers = [
"unit: Unit tests",
"integration: Integration tests",
"adapter: Adapter-specific tests",
"tools: Tool functionality tests",
"server: Server lifecycle tests",
"performance: Performance tests",
"security: Security-related tests",
"slow: Tests that take longer to run",
"windows_only: Tests that require Windows OS",
"solidworks_only: Tests that require SolidWorks installation",
"smoke: Tests that make live LLM API calls (require GH_TOKEN or ANTHROPIC_API_KEY — excluded from CI)",
]
filterwarnings = [
"error",
"ignore::UserWarning",
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
"ignore::sqlalchemy.exc.SAWarning",
]
asyncio_mode = "auto"
log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s [%(levelname)8s] %(name)s: %(message)s"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
timeout = 300
[tool.coverage.run]
source = ["src/solidworks_mcp"]
# Measure child Python processes too: the "dependency not installed" import
# fallbacks are tested by importing a module in a subprocess with the
# dependency blocked (see the import_without fixture in tests/conftest.py).
patch = ["subprocess"]
omit = [
"*/tests/*",
"*/test_*",
"*/__pycache__/*",
"*/migrations/*",
]
# Only genuinely non-executable lines are excluded. There is no
# "pragma: no cover": unreachable code is deleted, not hidden (see
# openspec/changes/archive/2026-10-30-full-coverage-and-error-boundary/dead-code.md).
[tool.coverage.report]
exclude_lines = [
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.mypy]
python_version = "3.13"
platform = "win32"
exclude = [
"src/utils/",
]
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
# Ignore missing imports for Windows-specific modules on other platforms
[[tool.mypy.overrides]]
module = [
"win32com.*",
"pythoncom",
"pywintypes",
"win32api",
"win32con",
"win32gui",
"win32process",
# Optional extras, not installed by every environment that type-checks.
"PIL",
"PIL.*",
"faiss",
"sentence_transformers",
]
ignore_missing_imports = true
# Prefab UI files (solidworks_mcp.ui.prefab_dashboard, .prefab_trace_probe) were
# removed - dead code for a UI approach superseded by SolidWorks-as-Code.
[[tool.mypy.overrides]]
module = [
"solidworks_mcp.ui.local_llm",
"solidworks_mcp.ui.service",
"solidworks_mcp.ui.server",
"solidworks_mcp.ui.services.llm_service",
]
ignore_errors = true
[tool.black]
target-version = ["py313"]
line-length = 88
skip-string-normalization = false
extend-exclude = '''
/(
\.git
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
| migrations
)/
'''
[tool.ruff]
target-version = "py313"
line-length = 88
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"C901", # too complex
]
unfixable = ["B"]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
"**/{tests,docs,tools}/*" = ["E402"]
[tool.ruff.lint.isort]
known-first-party = ["solidworks_mcp"]