-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
296 lines (277 loc) · 7.79 KB
/
Copy pathpyproject.toml
File metadata and controls
296 lines (277 loc) · 7.79 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
[project]
name = "libtmux-mcp"
version = "0.1.0a22"
description = "MCP server for tmux, powered by libtmux"
requires-python = ">=3.10,<4.0"
authors = [
{name = "Tony Narlock", email = "tony@git-pull.com"}
]
license = { text = "MIT" }
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Topic :: System :: Shells",
"Typing :: Typed",
]
keywords = ["tmux", "mcp", "model-context-protocol", "terminal", "ai"]
homepage = "http://github.com/tmux-python/libtmux-mcp/"
readme = "README.md"
packages = [
{ include = "*", from = "src" },
]
include = [
{ path = "CHANGES", format = "sdist" },
{ path = "tests", format = "sdist" },
{ path = "docs", format = "sdist" },
{ path = "conftest.py", format = "sdist" },
]
dependencies = [
"libtmux>=0.62.0,<1.0",
"fastmcp>=4.0.2,<5.0.0",
"regex>=2024.11.6",
]
[project.urls]
"Bug Tracker" = "https://github.com/tmux-python/libtmux-mcp/issues"
Documentation = "https://libtmux-mcp.git-pull.com"
Repository = "https://github.com/tmux-python/libtmux-mcp"
Changes = "https://github.com/tmux-python/libtmux-mcp/blob/master/CHANGES"
[project.scripts]
libtmux-mcp = "libtmux_mcp:main"
[dependency-groups]
dev = [
# Docs
"gp-sphinx==0.1.0a39",
"sphinx-autodoc-api-style==0.1.0a39",
"sphinx-autodoc-fastmcp==0.1.0a39",
"gp-libs>=0.0.19",
"sphinx-autobuild",
# Testing
"typing-extensions; python_version < '3.11'",
"gp-libs>=0.0.19",
"pytest>=9.1.0", # >=9.1.0 attaches caplog to non-propagating loggers; see test_middleware
"pytest-rerunfailures",
"pytest-mock",
"pytest-watcher",
"pytest-xdist",
"syrupy>=5.1.0",
# scripts/mcp_swap.py (PEP 723 script; dep listed here so tests can import it)
"tomlkit>=0.13",
# tests/docs/test_compatibility.py compares version ranges, not strings.
"packaging",
# Coverage
"codecov",
"coverage",
"pytest-cov",
# Lint
"ruff>=0.16.1",
"mypy",
"types-regex",
]
docs = [
"gp-sphinx==0.1.0a39",
"sphinx-autodoc-api-style==0.1.0a39",
"sphinx-autodoc-fastmcp==0.1.0a39",
"gp-libs>=0.0.19",
"sphinx-autobuild",
]
testing = [
"typing-extensions; python_version < '3.11'",
"gp-libs>=0.0.19",
"pytest>=9.1.0", # >=9.1.0 attaches caplog to non-propagating loggers; see test_middleware
"pytest-rerunfailures",
"pytest-mock",
"pytest-watcher",
]
coverage =[
"codecov",
"coverage",
"pytest-cov",
]
lint = [
"typing-extensions; python_version < '3.11'",
"ruff>=0.16.1",
"mypy",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.uv.exclude-newer-package]
# git-pull packages release in lockstep with their workspaces, so a
# fresh release blocking on the 3-day cooldown blocks every
# contributor's `uv sync` until it clears. `false` exempts each
# from any `exclude-newer` constraint (global or per-user) without
# committing a date that would age into the lockfile. Mirrors the
# pattern at vcspull/pyproject.toml for libvcs.
libtmux = false
gp-libs = false
gp-furo-theme = false
gp-sphinx = false
sphinx-autodoc-api-style = false
sphinx-autodoc-argparse = false
sphinx-autodoc-docutils = false
sphinx-autodoc-fastmcp = false
sphinx-autodoc-pytest-fixtures = false
sphinx-autodoc-sphinx = false
sphinx-autodoc-typehints-gp = false
sphinx-fonts = false
sphinx-gp-opengraph = false
sphinx-gp-llms = false
sphinx-gp-sitemap = false
sphinx-gp-theme = false
sphinx-ux-autodoc-layout = false
sphinx-ux-badges = false
fastmcp = false
fastmcp-slim = false
[tool.mypy]
strict = true
python_version = "3.10"
files = [
"src",
"tests",
]
exclude = ["^docs/"]
[[tool.mypy.overrides]]
module = ["docutils", "docutils.*"]
ignore_missing_imports = true
[tool.coverage.run]
branch = true
parallel = true
omit = [
"docs/conf.py",
"tests/test_*.py",
"tests/*/test_*.py",
]
[tool.coverage.report]
show_missing = true
skip_covered = true
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"return NotImplemented",
"def parse_args",
"if TYPE_CHECKING:",
"if t.TYPE_CHECKING:",
"@overload( |$)",
'class .*\bProtocol\):',
"from __future__ import annotations",
"import typing as t",
"^\\s*\\.\\.\\.$",
"^\\s*pass$",
"^\\s*assert ",
"^\\s*logger\\s*=",
"^import ",
"^from .* import",
": TypeAlias = ",
"= t\\.TypeVar\\(",
]
[tool.ruff]
target-version = "py310"
[tool.ruff.lint]
# `select` is deliberately unset: ruff 0.16 enables a curated default rule
# set, and an explicit `select` would replace it rather than extend it.
# `extend-select` layers this project's additional linters on top.
extend-select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"A", # flake8-builtins
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"COM", # flake8-commas
"EM", # flake8-errmsg
"Q", # flake8-quotes
"PTH", # flake8-use-pathlib
"SIM", # flake8-simplify
"TRY", # Trycertatops
"PERF", # Perflint
"RUF", # Ruff-specific rules
"D", # pydocstyle
"FA100", # future annotations
]
ignore = [
"COM812", # missing trailing comma, ruff format conflict
]
extend-safe-fixes = [
"UP006",
"UP007",
]
pyupgrade.keep-runtime-typing = false
[tool.ruff.lint.isort]
known-first-party = [
"libtmux_mcp",
]
combine-as-imports = true
required-imports = [
"from __future__ import annotations",
]
[tool.ruff.lint.flake8-builtins]
builtins-allowed-modules = [
"dataclasses",
"random",
"types",
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.per-file-ignores]
"*/__init__.py" = ["F401"]
# The Sphinx conf idiom: `exec` the package's `__about__.py` to read
# version metadata without importing the package (and its dependencies)
# into the docs build. The path is a repo-local file, not user input.
"docs/conf.py" = ["S102"]
# Boundary catch-alls. Every `except Exception` in these files converts
# an arbitrary failure into a reported result or a debug log instead of
# letting it escape a place that cannot report it:
# middleware.py the MCP error boundary, renders any tool exception
# as an `is_error` result
# batch_tools.py isolates one failed operation from its batch
# pane_tools/io.py same, per send_keys operation
# server.py best-effort buffer GC during lifespan shutdown
# server_tools.py best-effort tmux metadata probes over sockets that
# may be stale, denied, or running an old tmux
# mcp_swap.py restores a CLI config's original bytes when a
# write fails
# tmux and the CLI configs fail in more ways than a narrowed clause can
# enumerate, so narrowing here trades a logged degradation for a crash.
"scripts/mcp_swap.py" = ["BLE001"]
"src/libtmux_mcp/middleware.py" = ["BLE001"]
"src/libtmux_mcp/server.py" = ["BLE001"]
"src/libtmux_mcp/tools/batch_tools.py" = ["BLE001"]
"src/libtmux_mcp/tools/pane_tools/io.py" = ["BLE001"]
"src/libtmux_mcp/tools/server_tools.py" = ["BLE001"]
[tool.pytest.ini_options]
addopts = [
"--tb=short",
"--no-header",
"--showlocals",
"--doctest-modules",
"--doctest-docutils-modules",
"--reruns=2"
]
doctest_optionflags = [
"ELLIPSIS",
"NORMALIZE_WHITESPACE"
]
testpaths = [
"src/libtmux_mcp",
"tests",
]
filterwarnings = [
"ignore:The frontend.Option(Parser)? class.*:DeprecationWarning::",
"ignore::DeprecationWarning:libtmux.*:",
"ignore::DeprecationWarning:libtmux_mcp.*:",
"ignore::DeprecationWarning:tests:",
]