Skip to content

Conversation

phw
Copy link
Member

@phw phw commented Aug 16, 2025

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Problem

I personally find the pytest run on every commit a bit annoying. This makes every commit take quite some time, while I can easily run pytest on demand and do so during development anyway. I'd rather prefer to run pytest mandatorily pre-push.

This PR changes the pre-commit configuration to setup both a pre-commit and pre-push hook and run pytest only pre-push. All other tasks will be run both pre-commit and pre-push.

One needs to re-run pre-commit install to apply the changes.

This is now a push can look like with this config:

(picard) phw@bender ~/devel/musicbrainz/picard % git push phw
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
mixed line ending........................................................Passed
ruff (legacy alias)..................................(no files to check)Skipped
ruff format..........................................(no files to check)Skipped
Sync uv.lock with pyproject.toml.........................................Passed
pip-compile requirements.txt.............................................Passed
pip-compile requirements-build.txt.......................................Passed
pip-compile requirements-dev.txt.........................................Passed
pip-compile requirements-plugins.txt.....................................Passed
Run pytest...............................................................Passed
Objekte aufzählen: 5, fertig.
Zähle Objekte: 100% (5/5), fertig.
Delta-Kompression verwendet bis zu 16 Threads.
Komprimiere Objekte: 100% (3/3), fertig.
Schreibe Objekte: 100% (3/3), 1021 Bytes | 1021.00 KiB/s, fertig.
Gesamt 3 (Delta 2), Wiederverwendet 0 (Delta 0), Pack wiederverwendet 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
remote: 
remote: Create a pull request for 'test' on GitHub by visiting:
remote:      https://github.com/phw/picard/pull/new/test
remote: 
To github.com:phw/picard.git
 * [new branch]          test -> test

@phw phw requested a review from zas August 16, 2025 21:03
@phw
Copy link
Member Author

phw commented Aug 16, 2025

@zas @knguyen1 Up for discussion

Copy link
Collaborator

@zas zas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks fine to me, I agree running tests on each commit is a bit annoying.

@knguyen1
Copy link
Contributor

@zas @knguyen1 Up for discussion

This is a good idea. I like this change.

@phw phw merged commit ebec9a0 into metabrainz:master Aug 16, 2025
45 checks passed
@phw phw deleted the pre-push-pytest branch August 16, 2025 23:29
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.

3 participants