Quantcast
Viewing latest article 38
Browse Latest Browse All 50

[分享创造] 将 Python 项目打包成一个 binary,即使没有 Python 解释器也能跑

打包的细节可以看这个 PR: https://github.com/laixintao/iredis/pull/279

非常简单,用 PyOxidizer 打包之后自动上传到 github 的 release,只要写好这个 Github Action 之后,以后只要在 master 打 tag 就会自动 release。

缺点就是 PyOxidizer 打包,如果第三方依赖(几乎是必然)有 __file__ 的依赖的话,就无法打包成一个文件,必须带一个 lib/ 目录。

有兴趣的可以在 release 页面下载 tar 解压之后运行一下。

github: https://github.com/laixintao/iredis


Viewing latest article 38
Browse Latest Browse All 50

Trending Articles