You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Annotate every function, parameter and module-level variable in
`keycmd`, and ship a `py.typed` marker so downstream consumers get the
types too.
Typing the config surface required describing its shape, so the
[keys] and [aliases] tables are now `TypedDict`s. `load_conf` casts to
that shape at the boundary where user authored TOML enters the program,
which is where the promise is actually made.
Enforcement, so this does not decay:
- ruff's `ANN` rules require annotations (the test suite is exempt).
- ty's off-by-default rules are enabled: `missing-type-argument`,
`possibly-missing-attribute`, `possibly-missing-import`,
`possibly-unresolved-reference` and `division-by-zero`. Suppressions
must name a rule and must be needed (`blanket-ignore-comment`,
`unused-ignore-comment`).
- CI and pre-commit run `ty check --error-on-warning`, so warn-level
diagnostics fail rather than scroll by.
Two fixes fell out of making the types honest:
- `shell.exec` passed `env=None` straight to `os.execvpe`, which
requires a mapping and would have raised `TypeError`. It now falls
back to `os.environ`, matching what the subprocess branch already did.
- `creds.get_env` bound both the loop variable and the looked up key
data to the name `key`, so the two had different types under one name.
They are now `key`/`data` and `src`/`alias_src`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011nTpsbs48Pcky9GVthXnWv
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -401,6 +401,8 @@ See the [third party backends](https://github.com/jaraco/keyring/#third-party-ba
401
401
402
402
This project uses [uv](https://docs.astral.sh/uv/) for dependency management, [ruff](https://docs.astral.sh/ruff/) for linting and formatting, and [ty](https://docs.astral.sh/ty/) for type checking.
403
403
404
+
The `keycmd` package is fully annotated and ships a `py.typed` marker, so the types are available to anything that imports it. Ruff's `ANN` rules keep it that way; the test suite is exempt.
405
+
404
406
```bash
405
407
# create the virtual environment and install all dependencies
0 commit comments