How do I code-sign an executable created by a python wheel?

445 views Asked by At

I'm creating a python package with an executable as a wheel using setuptools. My simplified setup.py file looks like this:

setup(
    name="mypackage",
    version="1.0.0",
    entry_points={"console_scripts": {"mypackage = mypackage.cli:cli"}}
)

Command to create the python package:

python setup.py bdist_wheel

When installing the resulting wheel, a mypackage.exe file is created in the scripts directory as expected.

How can I make sure, that the created executable is code-signed with a given certificate? I know how to code sign an existing executable using signtool.exe or Powershell, but since the executable seems to be created on the client machine when the wheel is installed, I don't know how to do it.

0

There are 0 answers