-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post-merge hook for lockfile sync #17
Comments
I think |
Definitely don't want to be committing the virtual environment. This would be running post-merge rather than pre-commit. If you are working on a codebase with a frequently changing lockfile, then often the One way to deal with this is to display a warning when the lockfile is out-of-sync with the current environment, but if it's happening frequently, users might just want to automatically run |
This is exactly what I was looking for 😄 My projects are currently based on Poetry and I have these hooks set-up, and they are just great to keep project in sync, especially since dependabot updates my dependencies on a daily basis. |
|
Correct me if wrong but I assume there is no perfect solution for this.
Therefore, adding a Basically, With this consideration, a sample hook will look like this: - id: uv-sync
name: uv-sync
description: "Automatically run 'uv sync' after merge or pull"
entry: uv sync --locked
language: python
args: []
stages: [post-merge]
always_run: true
pass_filenames: false
additional_dependencies: []
minimum_pre_commit_version: "2.9.2" |
You are right, however Besides, I remember git hooks are providing base and head commits, I don't know if |
…void unnecessary overhead Fixes astral-sh#17
…void unnecessary overhead Fixes astral-sh#17
…void unnecessary overhead Fixes astral-sh#17
…void unnecessary overhead Fixes astral-sh#17
One workflow that could be quite nice is to automatically run
uv sync
post-merge if there are any incoming changes to the lock file. That way, everyone's development environments can stay synchronized automatically.The text was updated successfully, but these errors were encountered: