Skip to content
Open
18 changes: 4 additions & 14 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,11 @@ def lint(s: nox.Session, /) -> None:

@session(uv_groups=["lint"], reuse_venv=True)
def precommit(s: nox.Session, /) -> None:
"""Run the pre-commit hooks."""
# no-commit-to-branch guards a human's local `git commit`/`git push`,
# not a manual "run every hook over all files" invocation like this
# one -- which CI also runs on every push to `main`, where it would
# otherwise always fail. Skipped here (locally or in CI); the
# installed git hook still catches the real case. Add it to any SKIP
# a caller already set, rather than clobbering it.
"""Run the pre-commit hooks (via prek)."""
# Not a real commit -- no-commit-to-branch would always fail here.
# Merge into any SKIP already set, rather than clobber it.
skip = ",".join(filter(None, [os.environ.get("SKIP"), "no-commit-to-branch"]))
s.run(
"pre-commit",
"run",
"--all-files",
*s.posargs,
env={"SKIP": skip},
)
s.run("prek", "run", "--all-files", *s.posargs, env={"SKIP": skip})


@session(uv_groups=["lint"], reuse_venv=True)
Expand Down
16 changes: 9 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ build = [
]
lint = [
"mypy>=1.19.0",
"pre-commit>=4.1.0",
"prek>=0.5.3",
"pylint>=3.3.8",
]
nox = [
Expand Down Expand Up @@ -193,12 +193,14 @@ src = ["src"]

[tool.uv]
constraint-dependencies = [
# `pre-commit` allows any `nodeenv>=0.11.1`, and 0.11.1 is a 2012 sdist whose
# `setup.py` imports `pkg_resources` at build time -- long gone from modern
# setuptools, so `--resolution lowest` cannot build it and the "Check Oldest
# Dependencies" job dies before collecting a single test. Dev tooling: its
# floor says nothing about which dependencies this library supports.
"nodeenv>=1.9.1",
# `commitizen` (pulled in via `cz-conventional-gitmoji`) allows any bare
# `pyyaml`, and `--resolution lowest` picks 3.10 -- a 2013 sdist that fails
# to build against modern CPython's C API (`PyCode_New`'s signature
# changed, `PyFrameObject` is now an incomplete type). `pre-commit` used to
# mask this by requiring `pyyaml>=5.1`; switching it out for `prek` removed
# that floor. Dev tooling: its floor says nothing about which dependencies
# this library supports.
"pyyaml>=5.1",
# `build` depends on a bare, unbounded `pyproject_hooks`, so `--resolution
# lowest` picks 0.1.0 -- a 2021 release predating `BuildBackendHookCaller`,
# which `build` 1.x calls unconditionally, so `nox -s build` dies with an
Expand Down
59 changes: 16 additions & 43 deletions uv.lock

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

Loading