-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
206 lines (194 loc) · 9.66 KB
/
Copy pathpyproject.toml
File metadata and controls
206 lines (194 loc) · 9.66 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
[project]
name = "termapy"
version = "0.73.0"
description = "A TUI serial terminal with ANSI color support, built on Textual and pyserial"
license = "MIT"
requires-python = ">=3.11"
readme = "README.md"
authors = [{name = "Chuck Bass", email = "chuck@acrocad.net"}]
keywords = ["serial", "terminal", "tui", "textual", "pyserial", "embedded", "xmodem", "ymodem"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Communications",
"Topic :: System :: Hardware",
"Topic :: Terminals :: Serial",
]
dependencies = [
# Core TUI framework (without [syntax] extra to avoid installing 16 tree-sitter
# grammars - we only need json, toml, bash for our editors, listed below)
"textual>=0.80",
# pyserial is vendored in src/termapy/vendor/serial/ (see vendor/LICENSES.md)
"prompt-toolkit>=3.0",
"pygments>=2.20.0",
# Syntax highlighting for TextArea editors (config=json, proto=toml,
# scripts=bash). Upper bounds capped to the next-minor of the
# currently-tested release; pre-1.0 tree-sitter libraries routinely
# break their API between minor versions. Bump the caps manually
# after smoke-testing a new release locally.
"tree-sitter>=0.25.0,<0.26; python_version >= '3.10'",
"tree-sitter-json>=0.24.0,<0.25; python_version >= '3.10'",
"tree-sitter-toml>=0.6.0,<0.8; python_version >= '3.10'",
"tree-sitter-bash>=0.23.0,<0.26; python_version >= '3.10'",
# PEP 440 version parsing for the update_check module (release-notification
# path). Used to compare an installed termapy version against the latest
# PyPI release.
"packaging>=24.0",
# Cross-platform user state / config directory resolution (replaces
# per-OS hand-rolled APPDATA / XDG handling for app-level state).
"platformdirs>=4.0",
# CRC catalog + multi-language code generation. Originally bundled
# under termapy.protocol.crcgen; extracted to its own PyPI package
# in 2026-05 so engineers who need just the codegen don't pull in
# a TUI dependency tree. termapy.protocol.crc remains as a thin
# shim re-exporting the pure CRC bits (CRC_CATALOGUE, _generic_crc).
# 0.10 dropped the short termapy-side aliases (crc16m, crc16x, ...)
# from the catalog and replaced the per-language ``table=bool``
# kwarg on the codegen generators with ``variant=Literal["bitwise",
# "table", "slice8"]``. 0.11 added a required ``source`` field on
# ``AlgorithmInfo``; the --custom path in /proto.crc.<lang> passes
# ``source="user"``, which 0.10 rejects. 0.12 added Java as a
# codegen target; termapy's dynamic LANGUAGES loop picks it up
# automatically and the CLI gold file now expects /proto.crc.java.
# 0.13 added a per-language doc-comment style system
# (``comment_style=`` on every generator, per-language allowed set
# validated via ``crcglot.comments.registry.comment_style_for``)
# and a per-language ``combiner`` callable on ``LanguageInfo`` for
# bundling several algorithms into one file. /proto.crc.<lang>
# exposes both via ``style=NAME`` and multi-positional ``<name>...``;
# the floor moves to 0.15.1 (the first release where the public
# registry helpers ``comment_style_for`` and ``styles_for_language``
# ship under ``crcglot.comments.registry``; 0.15.1 is a patch-level
# follow-up on 0.15.0 with no API change). 0.16 / 0.17 ship
# internal refactors (combiner functions for the simple-string
# languages were consolidated to a shared ``combine_concat``;
# ``LanguageInfo.combiner`` still resolves the same per-language
# callable, so termapy's bundling path is unaffected). 0.18-0.23
# is the biggest API expansion since 0.13: the variant ladder
# gained an ``"auto"`` default that picks the fastest
# implementation per (language, width), the catalog grew from
# 62 to 100+ algorithms, and several brand-new top-level helpers
# landed -- ``compute`` / ``encode`` / ``verify`` /
# ``identify_trailer`` / ``reverse`` / ``CrcStream`` /
# ``has_faster_alternative`` / ``default_stem`` /
# ``LanguageInfo.variants_for_width(s)`` / ``Advisory``. termapy
# tracks the auto-variant change here (no-flag /proto.crc.<lang>
# now emits the fastest variant per (lang, width) instead of
# bitwise, matching the upstream CLI's ``--fast`` default); the
# other new helpers are surfaced incrementally on the Phase B
# branch (``--small``/``--fast`` flags, ``naming=`` kv arg,
# trailer-hint on /proto.crc.find, ``has_faster_alternative``
# advisory on /proto.crc.calc, /proto.crc.verify command,
# ``variants_for_width(s)`` / ``default_stem`` migrations).
# 0.24 / 0.25 are API-stable absorbing releases; 0.25 adds
# ``crcglot.suggest_algorithms`` (a three-tier typo helper:
# exact prefix -> width family -> fuzzy match) wired into the
# five "Unknown algorithm:" error sites in proto.py for
# "did you mean: ..." hints, plus a ``crcglot.exceptions``
# module (``CrcglotError``, ``UnknownAlgorithmError`` subclassing
# both ``CrcglotError`` and ``ValueError`` for backward compat)
# recorded for a future follow-up; not consumed here. 0.26
# tightens custom-parameter validation at construction (width
# 1..64, poly/init/xorout must fit the width -- silent masking
# is now a ``ValueError`` naming the field and range, which
# /proto.crc's custom= path surfaces verbatim) and publishes the
# self-test vectors as typed data (``self_test_vectors`` /
# ``SELF_TEST_INPUTS``; recorded for a future follow-up, not
# consumed here). Floor is
# tracked at the latest release so the lock pulls modern fixes
# and we surface any future API drift early. 0.27 shipped the
# frontend-neutral ``VERBS`` manifest (every verb + parameter as plain
# data -- types, enums, defaults, help); 0.28 added ``call_verb`` (invoke
# a verb from its manifest param names, returning a JSON-ready wire dict).
# termapy renders both into typed ``/proto.crc.*`` commands via
# ``builtins/commands/_crc_verbs.py``, so the floor moves to 0.28.0.
"crcglot>=0.28.0",
]
[project.optional-dependencies]
web = ["textual-serve>=1.1"]
mcp = ["mcp>=1.0,<2.0"]
# Catch-all for "I want everything; don't make me think about extras."
# Lazy imports inside termapy.entry mean unused deps cost nothing at
# runtime (TUI/CLI never load pydantic; --mcp never loads textual).
# Only the disk footprint adds up -- ~16 MB for [mcp] -- which is
# rounding error on any modern dev machine. The individual extras
# stay available for embedded / containerized installs that genuinely
# need a slim install.
all = ["termapy[mcp,web]"]
[tool.uv.build-backend]
# uv-build's default is to bundle EVERY file under src/termapy/ into
# the wheel (Python and non-Python alike). We drop the help markdown
# explicitly so wheels carry only the rendered HTML help. The in-app
# /help command serves the html/ tree via a local HTTP server, and
# /credits inlines its acknowledgments text as a Python constant.
# Keeping the markdown out of the wheel saves ~200 KB / ~4,100 lines
# per install; zensical builds the docs site from the repo, not the
# installed package.
#
# Patterns follow the glob crate syntax (PEP 639 portable globs).
# The two-pattern form here covers both top-level and nested files.
wheel-exclude = ["*.md", "**/*.md"]
[build-system]
requires = ["uv_build"]
build-backend = "uv_build"
[project.scripts]
termapy = "termapy:run"
[project.urls]
Homepage = "https://github.com/hucker/termapy"
Documentation = "https://hucker.github.io/termapy/"
Repository = "https://github.com/hucker/termapy"
Changelog = "https://github.com/hucker/termapy/blob/main/CHANGELOG.md"
Issues = "https://github.com/hucker/termapy/issues"
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-v --cov=termapy --cov-report=term-missing -n auto"
markers = [
"slow: subprocess-spawning, real-serial-loopback, or sleep-based test (~80s of full-suite runtime). Skip during fast iteration with -m 'not slow'.",
]
[tool.ty.environment]
# Vendored pyserial lives here. ty needs to see it as a search root so
# `import serial` resolves to termapy/vendor/serial/ at type-check time,
# matching the sys.path redirect that vendor/__init__.py does at runtime.
extra-paths = ["src/termapy/vendor"]
[tool.ty.src]
# Don't type-check the vendored code itself. pyserial uses Linux-only
# modules (fcntl, termios, select.POLL*) in its platform shims, and ty
# flags every reference as unresolved on Windows. We still need the
# extra-paths above so `import serial` resolves from our own code.
exclude = ["src/termapy/vendor/**"]
[tool.ruff]
# 100 (not the black-default 88) buys room for inline suppression reasons
# (`# noqa: CODE -- why`) and generally-descriptive names without wrapping.
line-length = 100
# Vendored pyserial uses wildcard imports, lowercase l/I/O variable
# names, and other patterns we don't own. Skip lint entirely; same
# reasoning as the ty exclude above.
exclude = ["src/termapy/vendor", "src/termapy/html"]
[tool.coverage.run]
source = ["src/termapy"]
omit = [
"src/termapy/__init__.py",
"src/termapy/builtins/*.py",
"src/termapy/app.py",
"src/termapy/dialogs/*.py",
"src/termapy/vendor/*",
]
[tool.coverage.report]
exclude_lines = [
"if __name__",
"pragma: no cover",
]
show_missing = true
[dependency-groups]
dev = [
"pytest-cov>=7.0.0",
"pytest-xdist>=3.8.0",
]