Skip to content

chore: move to uv, prek, ruff-format and ty (pyrepo patterns) - #39

Merged
tlambert03 merged 5 commits into
pyapp-kit:mainfrom
tlambert03:chore/modernize-tooling
Oct 26, 2026
Merged

tlambert03 merged 5 commits into
pyapp-kit:mainfrom
tlambert03:chore/modernize-tooling

Conversation

@tlambert03

@tlambert03 tlambert03 commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

this moves pyconify over to the current pyrepo template patterns: uv + dependency groups, prek, ruff-format instead of black, ty instead of mypy, and a uv-based CI workflow (instead of the pyapp-kit/workflows reusable test job).

build / tooling (be440a7)

  • test/dev extras are now PEP 735 dependency groups (with lower bounds). dropped pdbpp and black, added prek and ty. pip install pyconify[test] won't work anymore... uv sync or pip install -e . --group dev instead
  • requests>=2.30. 2.28 actually works too (tested locally), but uv locks all groups together and types-requests needs urllib3 2, so the lowest-direct job can't test anything older than 2.30
  • ruff uses extend-select on top of ruff's (now larger) defaults. none of the previously selected rules were removed, and I added D417 and ANN
  • PEP 639 license metadata, [tool.pytest] native table, uv.lock gitignored, and a Development section in the README

mypy -> ty

ty passes on src and tests (mypy only checked src), with error-on-warning = true. what we lose from mypy --strict:

  • disallow_untyped_defs ... replaced by ruff's ANN rules, so that's still enforced
  • warn_return_any ... ty has no equivalent. that's what the six # type: ignores on return resp.json() were for, so they're gone now (ty flags unused ignores)
  • no_implicit_reexport ... not sure ty has an equivalent yet

ty found a couple of real (minor) things in the tests that mypy never looked at.

fixes from the new hooks (496e6a9)

typos (_extention -> _extension, which is private, plus two docstring typos), BLE001 on the intentional except Exception fallback in _cache.py (kept, with a noqa), and ruff-format only changed a single blank line vs black.

CI (22391c8)

  • same Python/OS matrix (3.11-3.15 on ubuntu, 3.11 on windows/macos), plus an ubuntu 3.11 lowest-direct job
  • test-qt is gone. It was 4 jobs that each re-ran the entire suite (-k Py matches every test since -k is case-insensitive and everything lives under pyconify/), just for the one test_freedesktop_qt case. Now PyQt5 is added to the ubuntu 3.11 job and PySide6 to the ubuntu 3.14 job (one Qt5, one Qt6), and PySide2 is dropped
  • lint job running prek, SHA-pinned actions, per-job permissions
  • build-and-inspect + trusted publishing + gh release create for deploys
  • dependabot now also updates pre-commit hooks (kept the quarterly interval)
  • issue template -> issue form; TEST_FAIL_TEMPLATE.md removed (failure reporting is inline with gh now)

branch protection

the pre-commit config no longer has the ci: block (hook updates move to dependabot, linting to the 🧹 prek job), and pre-commit.ci can't run the ty hook anyway since it needs network to build the project. so I swapped main's required check from pre-commit.ci - pr (app 68672) to 🧹 prek (GitHub Actions, app 15368), strict unchanged. if this PR gets closed without merging, that should be reverted. other open PRs won't get the 🧹 prek check until they're rebased.

still to do by hand: turn off pre-commit.ci for this repo (it'll keep posting a failing, now non-required, check until then).

🤖 Generated with Claude Code

tlambert03 and others added 4 commits October 26, 2026 22:45
… ty)

- test/dev extras -> PEP 735 dependency groups, with lower bounds; drop
  pdbpp and black; add prek and ty; pyqt5/pyside6 groups for the Qt test
- requests>=2.30 (lowest version resolvable alongside urllib3 2)
- PEP 639 license metadata, hatchling>=1.27, src-only wheel
- ruff: extend-select on top of ruff's defaults (all previous rules kept),
  add D417 and ANN (replaces mypy's disallow_untyped_defs); ruff-format
  replaces black
- mypy -> ty (error-on-warning), checking src and tests
- pytest: native [tool.pytest] table
- pre-commit config from the pyrepo template (pre-commit-hooks,
  actionlint, zizmor, typos, ruff-check/format, ty); drop the pre-commit.ci
  block
- ignore uv.lock; add a Development section to the README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- typos: `_extention` -> `_extension` (private), docstring typos
- BLE001: keep the intentional fallback to an in-memory cache, with noqa
- ty: drop `type: ignore`s that only silenced mypy's warn_return_any;
  type the test ICONS mapping; `@contextmanager` returns `Generator`
- ruff-format: blank line in a docstring code example

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- replace the pyapp-kit/workflows reusable test job with setup-uv steps;
  same Python/OS matrix, plus a lowest-direct job for minimum deps
- Qt: instead of 4 extra jobs that re-ran the whole suite (`-k Py` matched
  everything), add PyQt5 to ubuntu 3.11 and PySide6 to ubuntu 3.14
- add a prek lint job; SHA-pinned actions; per-job permissions
- build-and-inspect-python-package + trusted publishing, gh release create
- --pre failure reporting via gh; drop TEST_FAIL_TEMPLATE.md
- dependabot: add pre-commit ecosystem and cooldown (still quarterly)
- issue template -> issue form

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hatchling finds src/pyconify on its own; the built wheel is identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b0ed34f) to head (ad41c4b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #39   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          276       276           
=========================================
  Hits           276       276           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Keeps them out of pyproject.toml and uv.lock; uv run --no-sync leaves the
extra package in place for pytest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tlambert03
tlambert03 merged commit efdec6b into pyapp-kit:main Oct 26, 2026
13 of 14 checks passed
@tlambert03
tlambert03 deleted the chore/modernize-tooling branch October 26, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant