MacOS 现在要求所有应用程序都经过强化、签名和公证。如何使用 PyInstaller 这样的工具对在 XCode 之外创建的应用程序进行签名和公证?
.app我已经整理了在 XTools 之外创建的文件的签名和公证。这里有一个非常有用的线程,展示了如何添加一个entitlements.plist来实现 PyInstaller 文件的强化.app。我相信这也适用于命令行实用程序,但可能会丢失一些东西。提交.dmg包含 a 的.app文件进行公证使用altool将通过测试并由 Apple 进行公证。
使用相同流程提交单个命令行实用程序也将通过公证,但不会出现在其他计算机上的 GateKeeper 功能上的签名或公证。Info.plist我认为这与 PyInstaller 二进制文件中未包含有效文件有关,如这篇有关为 Catalina 构建和交付命令行工具的博客文章中详细介绍的。
使用检查签名文件的签名codesign -dvv表明该Info.plist文件“未绑定”。
$ codesign -dvv ./dist/helloworld
Executable=/Users/aaronciuffo/Documents/src/toy/codesign/dist/helloworld
Identifier=helloworld
Format=Mach-O thin (x86_64)
CodeDirectory v=20500 size=72086 flags=0x10000(runtime) hashes=2244+5 location=embedded
Signature size=9054
Authority=Developer ID Application: Aaron Ciuffo (4H9P6Q65AM)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=Nov 2, 2020 at 9:03:30 …Run Code Online (Sandbox Code Playgroud) 为 nbconvert 指定自定义模板路径的正确方法是什么?
在 nbonvert 版本 6 下,模板现在是一个包含多个文件的目录。这些模板可以存在于任意数量的位置,具体取决于平台。
树莓派:
['/home/pi/.local/share/jupyter/nbconvert/templates', '/usr/local/share/jupyter/nbconvert/templates', '/usr/share/jupyter/nbconvert/templates']
Run Code Online (Sandbox Code Playgroud)
带有 Pyenv 的 OS X:
['/Users/ac/Library/Jupyter/nbconvert/templates', '/Users/ac/.pyenv/versions/3.8.5/Python.framework/Versions/3.8/share/jupyter/nbconvert/templates', '/usr/local/share/jupyter/nbconvert/templates', '/usr/share/jupyter/nbconvert/templates']
Run Code Online (Sandbox Code Playgroud)
我正在尝试在几个不同的平台上同步我的模板,并想指定一个自定义位置。
2 年前的这篇文章似乎是正确的,但似乎适用于 nbconvert 的 V5——该方法已将名称从 更改template_path为template_paths。
我已经尝试使用上面链接中建议的解决方案,使用我知道放置在已知位置之一时可以工作的模板。尝试按照建议指定自定义位置时,我最终遇到此错误:
jinja2.exceptions.TemplateNotFound: null.j2
我怀疑通过将路径设置为/path/to/.jupyter/templates/my_template/,我完全覆盖了所有其他模板位置并丢失了null.j2我的模板扩展的模板。我在最后包含了我的模板,因为它有一些导致这种情况的错误。
V6 配置文件的文档也没有太大帮助:
TemplateExporter.template_paths : List
Default: ['.']
No description
Run Code Online (Sandbox Code Playgroud)
和
PythonExporter.template_paths : List
Default: ['.']
No description
Run Code Online (Sandbox Code Playgroud)
从 2019 年 5 月开始,在 Git Repo 上有很长的讨论这个问题,但我不太明白最终的结论是什么。
我的自定义 Python 模板:
{%- extends 'null.j2' -%}
## set …Run Code Online (Sandbox Code Playgroud)