Post-`uv sync` hook for code generation pre development
Hi guys, this is a feature request.
I have some .proto files (Protobuf) I'd like to generate Python code for, at some point in time before the code runs.
A hook after uv sync would be a perfect place to run such code generation task.
Is it possible to implement something like that? If not, do you see any other elegant solution? Ideally it would be something the developers won't need to execute independently before running the actual code.
Thanks.
I like the idea, but there's not a clear way to do it right now we'd need to design it.
Related #5903
I understand. I'll be happy to contribute something like this myself once there's an agreeable design for it.
I would have used such a hook to apply a patch file on a broken dependency installed in the .venv.
Something like the postinstall hook from node would be interesting in uv IMO. We have some tasks that we need to run right after we run uv sync
+1 on this feature. Having some trouble coming up with a clean solution to injecting our company's self-sign certificates into certifi. Would love to do that as a postinstall hook to uv sync. It would allow us to remove a lot of verify=ctx SSL context objects we've had to create all over our code when instantiating httpx clients.
Another very strong usecase is having pre-commit hooks. If we keep the work of initializing pre-commit hooks manual, most of the contributor will forget it. Therefore, rendering it useless. It is best if such work can be done in a post-install/sync job.
PDM already has a similar support.