【问题标题】:Specify always to GnuPG sign uploads of a distribution to PyPI指定始终向 GnuPG 签名将分发上传到 PyPI
【发布时间】:2017-03-12 06:30:50
【问题描述】:
将分发上传到 PyPI 的 Distutils upload command 可以指定首先签署分发并上传该签名:
您可以使用--sign 选项告诉上传 对每个上传的文件进行签名
使用 GPG (GNU Privacy Guard) […] 您还可以指定使用哪个密钥
使用--identity=name 选项进行签名。
我如何指定对于特定分发,每次上传都应使用特定密钥进行签名?
【问题讨论】:
标签:
python
digital-signature
software-distribution
【解决方案1】:
Distutils 命令可以是configured with a setup.cfg file,方法是将选项值放在为命令命名的部分中。
因此,要为upload 命令指定sign 和identity 选项,请在分发版的setup.cfg 文件中写入:
[upload]
# Sign distributions, and upload the signing public key?
sign = true
# Which GnuPG identity to use for signing?
identity = christina@example.org