Skip to content

ci: Update pre-commit hooks and GitHub Action#2000

Merged
dmah42 merged 5 commits into
google:mainfrom
nicholasjng:pre-commit-changes
Aug 12, 2025
Merged

ci: Update pre-commit hooks and GitHub Action#2000
dmah42 merged 5 commits into
google:mainfrom
nicholasjng:pre-commit-changes

Conversation

@nicholasjng

@nicholasjng nicholasjng commented Jun 12, 2025

Copy link
Copy Markdown
Contributor

Using pre-commit together with uv gives a considerable speedup when running with --no-sync, and eliminates the need for our current elaborate caching setup in GitHub Actions.

Also adds the Python 3.13 trove classifier to pyproject.toml, since wheels for it have been published on PyPI.


Since uv is already used in cibuildwheel for Python virtual environment management, I figured it was a good idea to implement it here also. I've been running this setup (uv run pre-commit run ...) across multiple projects for a while now, including benchmark, so I consider it a well-tried approach.

As for the addition of --no-sync: This prevents the installation of google-benchmark into the virtual environment, which is good, since it is not necessary for pre-commit to begin with, and takes a good 20-30s on GitHub runners.

nicholasjng and others added 4 commits June 12, 2025 15:58
Using pre-commit together with uv gives a considerable speedup when running with `--no-sync`,
and eliminates the need for our current elaborate caching setup in GitHub Actions.
And invoke the pre-commit run only with the dev group enabled. This should avoid the costly install on sync.
@dmah42 dmah42 merged commit 593f861 into google:main Aug 12, 2025
83 of 84 checks passed
BuildMonkey pushed a commit to BuildMonkey/benchmark that referenced this pull request Aug 13, 2025
* ci: Update pre-commit hooks and GitHub Action

Using pre-commit together with uv gives a considerable speedup when running with `--no-sync`,
and eliminates the need for our current elaborate caching setup in GitHub Actions.

* chore: Switch pre-commit to a PEP735 dependency group

And invoke the pre-commit run only with the dev group enabled. This should avoid the costly install on sync.

---------

Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
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.

2 participants