chore: Migrate tooling to uv, prek, ruff and ty#309
Conversation
a0dd495 to
e28255a
Compare
|
Tested on my Mac. @miketheman can you confirm it works for you too? |
3618157 to
71f2e1b
Compare
|
Tests and checks are passing on my mac. I freshly cloned the repo and checked out this branch. |
miketheman
left a comment
There was a problem hiding this comment.
Nice stuff! I ran it both inside and outside of nix, hence the comments.
The nix-shell still doesn't express a git command, which the new logic for determining whether to run is now before the pre-commit check, so that fails make lint
make types fails for an odd reason - the ty executable cannot be found ? I spent some time trying to debug this on my own, but got a bit lost.
71f2e1b to
50aaa45
Compare
Added.
In nix-shell or outside? |
in nix-shell |
I tried on three separate machine and CI, so it seems it's something one your machine that pollutes nix shell. Can you try |
eb1d6e2 to
1d08b38
Compare
Replace poetry with uv, pre-commit with prek, black/flake8/isort/autoflake with ruff, and mypy/typecov with ty. Adopt the wider prek check suite used by sister projects (codespell, taplo, yamlfmt, shellcheck, actionlint, zizmor, detect-secrets, debug-statement and Nix checks) and fix the findings across the codebase. Also: - bump the supported Python range to 3.11-3.14 (drop 3.10); replace the py310/ poetry lock with a committed uv-oldest.lock (lowest-direct, regenerated via `make lock`) for the oldest-deps Python 3.11 CI job - pin openapi-core to <0.20: 0.23 removed SchemaPath.contents(), so a fresh resolution installed a release that is broken with this addon - rewrite shell.nix as a tools-only nixpkgs 26.05 shell that provides python311/python314; drop poetry2nix - build with the uv_build backend; move pytest/coverage config into pyproject.toml; drop the typecov badge - switch the release workflow to `uv build`/`uv publish` and `gh release`
1d08b38 to
01428ca
Compare
- Installing `detect-secrets` on its own doesn't include the required `gibberish` dependency to run Refs: https://github.com/NixOS/nixpkgs/blob/bd0ff2d3eac24699c3664d5966b9ef36f388e2ca/pkgs/development/python-modules/detect-secrets/default.nix#L34 Refs: https://github.com/Yelp/detect-secrets/blob/5e141933554a0b74e7341841f318be21e895339c/setup.py#L46-L48 - Running `prek -a` in a pure nix shell fails to download hooks from https://github.com/pre-commit/pre-commit-hooks due to missing certificate bundle Refs: #309 Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Replace poetry with uv, pre-commit with prek, black/flake8/isort/autoflake with ruff, and mypy/typecov with ty. Adopt the wider prek check suite (codespell, taplo, yamlfmt, shellcheck, actionlint, zizmor, detect-secrets, debug-statement and Nix checks) and fix the findings across the codebase.
Also:
uv sync --resolution lowest-directfor exercising the oldest supported dependencies on Python 3.10uv build/uv publishandgh release