Skip to content
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

The uv-lock hook updates uv.lock but does not commit it #26

Open
Adirelle opened this issue Nov 24, 2024 · 4 comments
Open

The uv-lock hook updates uv.lock but does not commit it #26

Adirelle opened this issue Nov 24, 2024 · 4 comments

Comments

@Adirelle
Copy link

I am not sure what the uv-lock is supposed to do:

  • If it is supposed to check that the lockfile is up to date with regard to pyproject.toml, it should be run with the --locked to report any issue .
  • If it is supposed to actually update the lockfile on commit, it should also automatically add the modified uv.lock to the git index so it gets included in the commit.

Right now it seems to be something in between: the lockfile is updated but not commited, and so it appears as a modified file after the commit has been done.

@Adirelle Adirelle changed the title The uv-lock hook updates uv.lock The uv-lock hook updates uv.lock but does not commit it Nov 24, 2024
@thisiswhereitype
Copy link

I think this i pre-commit behaviour, failed commands and changes to tracked files indicate a failed hook.

This hook stops you committing an environment differing to the one you have uv sync.

@Adirelle
Copy link
Author

Without --locked (the current settings of the hook), uv lock updates the lockfile with success so it does not stop committing.

With --locked, it does not update the file but fails, but could be more useful.

@thisiswhereitype
Copy link

thisiswhereitype commented Dec 17, 2024

Without --locked (the current settings of the hook), uv lock updates the lockfile with success so it does not stop committing.

In this case the changed file stops the commit?

@Adirelle
Copy link
Author

Without --locked (the current settings of the hook), uv lock updates the lockfile with success so it does not stop committing.

In this case the changed file stops the commit?

IIRC it commited the unchanged file and left the modified file in the working tree.

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

No branches or pull requests

2 participants