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
Adopt the same project setup as the observ repo:
- Require Python 3.13+ and drop the `tomli` dependency in favour of
stdlib `tomllib`. Unpin `keyring` (~=24.3 -> >=25.6) and `shellingham`.
- Switch the build backend from flit to hatchling and move dev
dependencies from an optional-dependencies extra to PEP 735
dependency groups (dev/ruff/ty), with uv as the package manager.
- Derive `__version__` from package metadata so the version is declared
in one place only.
- Extend the ruff lint selection (isort, flake8-debugger, flake8-print)
and drop the ignores that no longer apply.
- Add ty type checking and a pre-commit config running format, lint,
typecheck and tests. Annotate `error()` as `NoReturn`, which is what
it always was and what ty needs to see to narrow correctly.
- Reorganize CI into separate lint, typecheck, test, build and publish
jobs driven by uv, upgrade all actions to their latest versions and
pin third-party actions by commit SHA. Tests now run on Python 3.13
and 3.14; the matrix stays on Windows because the suite needs an OS
keyring that unlocks unattended.
- Document the development workflow and the 3.13+ requirement in the
README.
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
+35-2Lines changed: 35 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,12 +18,20 @@ The most common use case is to load credentials for package managers such as pip
18
18
19
19
## Installation
20
20
21
+
`keycmd` requires Python 3.13 or newer.
22
+
21
23
> **Note**
22
24
> If you're intending to install `keycmd` in a WSL or pyenv environment, you'll have to skip ahead to the specific installation instructions for those environments.
23
25
24
26
### Global installation
25
27
26
-
Install `keycmd` from pypi using `pip install keycmd`, or whatever alternative python package manager you prefer.
28
+
Since `keycmd` is a command line tool, the recommended way to install it is with [uv](https://docs.astral.sh/uv/):
29
+
30
+
```bash
31
+
uv tool install keycmd
32
+
```
33
+
34
+
This installs `keycmd` into its own isolated environment and puts the executable on your `PATH`. Alternatively, install it from pypi using `pip install keycmd`, or whatever alternative python package manager you prefer.
27
35
28
36
Note that the executable `keycmd` has to be installed to a folder that is on your `PATH` environment variable, or the command won't be available globally. Assuming you were able to run `pip` just now, the `keycmd` executable should end up in the exact same location and everything should be fine.
29
37
@@ -42,7 +50,7 @@ Run the following commands one by one to install keycmd into its own standalone
Since keycmd uses keyring as its backend, you're not limited to just working with OS keyrings. 🤯 Any keyring backend will work with keycmd. No special configuration required!
389
397
390
398
See the [third party backends](https://github.com/jaraco/keyring/#third-party-backends) list for all options.
399
+
400
+
## Development
401
+
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
+
404
+
```bash
405
+
# create the virtual environment and install all dependencies
406
+
uv sync
407
+
408
+
# install the git hooks that run the checks below on every commit
409
+
uv run pre-commit install
410
+
411
+
# lint, format, typecheck and test
412
+
uv run ruff check --fix
413
+
uv run ruff format
414
+
uv run ty check
415
+
uv run pytest tests
416
+
```
417
+
418
+
Note that the test suite exercises a real OS keyring, so it needs a keyring backend that can be unlocked without user interaction. On Windows that works out of the box, which is why CI runs the tests there. On other platforms you can point keyring at a file-based backend instead:
419
+
420
+
```bash
421
+
uv run --with keyrings.alt pytest tests
422
+
# with PYTHON_KEYRING_BACKEND=keyrings.alt.file.PlaintextKeyring set in your environment
0 commit comments