Replies: 1 comment
-
|
The build environment can be configured just like any other environment so I suppose in theory you could try this? https://hatch.pypa.io/1.16/config/environment/overview/#pre-install |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am experimenting with using uv with hatch as the build back system to build python packages. A minimal pyproject.toml might look like this:
When I build the project with
uv buildI get the errorThis is due to my restrictive environment forces me to either use whitelisted signed executables, or sign them myself with SignTool.
Since astral.sh do not (yet) sign their distributed python executables, I would like to make a build hook that signs
python.exeafter the build environment is created but before python has been run.My first thought was that this was uv:s responsibility (astral-sh/uv#14401 (comment)) but I guess everything in the build is passed to hatch?
Reading about build hooks I added
and created a
hooks/my_hook.pyHowever, I get the same "Blocked by group policy error". My theory is that (naturally) hatch first creates an isolated build environment in C:\Users\Fredrik\AppData\Local\uv\cache\builds\v0.tmpdAXY1O and uses that environment in the "initialize" hook call.
I need to call a hook that executes a script BEFORE the python initialization hook to sign the python itself. Is this possible?
Beta Was this translation helpful? Give feedback.
All reactions