Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
run: uv run ruff check .
- name: Format check (ruff format)
run: uv run ruff format --check .
- name: Type check (ty)
run: uv run ty check --output-format github
- name: Check types with ty
run: uv run ty check --python-version ${{ matrix.python-version }} --output-format github
- name: Tests (pytest)
if: matrix.python-version != '3.14'
run: uv run pytest -m ""
Expand All @@ -61,8 +61,8 @@ jobs:
python-version: "3.14"
- name: Install dependencies
run: uv sync --all-groups
- name: Type check (ty)
run: uv run ty check --output-format github
- name: Check types with ty
run: uv run ty check --python-version 3.14 --output-format github
- name: Tests (pytest + POSIX PTY)
run: uv run pytest -m ""

Expand All @@ -82,8 +82,8 @@ jobs:
python-version: "3.14"
- name: Install dependencies
run: uv sync --all-groups
- name: Type check (ty)
run: uv run ty check --output-format github
- name: Check types with ty
run: uv run ty check --python-version 3.14 --output-format github
- name: Tests (portable core + stream)
run: uv run pytest -m ""

Expand Down
17 changes: 17 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ Python >= 3.12 is the compatibility floor, and runtime dependencies stay
empty (`dependencies = []`). Importing `libvt` performs no I/O and does
not load `asyncio`, `pty`, or `pytest`.

## Python typing

Give callers the most precise signature that covers supported behavior. Use
`object` for a parameter only when every value is valid or when the function
accepts unknown input for validation. Narrow unknown values before using them.
Reserve `Any` for an inherently dynamic interface where Python cannot express
the input contract. Explain the reason there and keep unchecked values out of
the rest of the API.

Before weakening a type, inspect real callers and try a precise alternative.
A union can describe known alternatives, a protocol can name the operations a
caller must provide, and a type parameter can preserve the relationship between
an input and its result. Try both a supported call and a plausible misuse with
ty. Check what downstream callers infer, whether the error is understandable,
and whether existing valid calls still work. Never widen a type, cast a value,
or suppress a diagnostic solely to make the checker pass.

## References

- Repository: https://github.com/tmux-python/libvt
Expand Down
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
_Notes on the upcoming release will go here._
<!-- END PLACEHOLDER - ADD NEW CHANGELOG ENTRIES BELOW THIS LINE -->

CI runs ty on the terminal package, test suite and development scripts at the supported Python targets. ([#70](https://github.com/tmux-python/libvt/pull/70))

## libvt 0.0.1a3 (2026-11-29)

`libvt` 0.0.1a3 adds mode-40-gated `80`/`132`-column switching
Expand Down
12 changes: 3 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ dev = [
"pytest-cov",
# Lint / typecheck
"ruff>=0.17.3",
"ty>=0.0.58",
"ty==0.0.113",
# Benchmark harness
"click>=8.1",
"pydantic>=2.12",
Expand All @@ -85,7 +85,7 @@ coverage = [
]
lint = [
"ruff>=0.17.3",
"ty>=0.0.58",
"ty==0.0.113",
]

[build-system]
Expand Down Expand Up @@ -115,6 +115,7 @@ include = [
python-preference = "system"

[tool.uv.exclude-newer-package]
ty = false
gp-furo-theme = false
gp-libs = false
gp-sphinx = false
Expand All @@ -141,13 +142,6 @@ python-version = "3.12"
[tool.ty.rules]
blanket-ignore-comment = "error"

[tool.ty.src]
include = [
"scripts",
"src",
"tests",
]

[tool.ty.terminal]
error-on-warning = true

Expand Down
47 changes: 24 additions & 23 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading