当使用我的 Egg 部署一些支持二进制文件时,如何让 setuptools 设置可执行位?
我正在使用 setuptools 创建一个 Egg,我想在其中包含一些支持二进制文件,最好安装在 Egg 目录中。
我可以将这些文件包含在 data_files
或 package_data
中,但是在部署它们时不会设置可执行位。
或者,我可以使用脚本,但随后它们将(默认情况下)部署到由所有其他包共享的公共目录,我想避免这种情况。
如何使用我的包部署这些二进制文件并确保保留它们的文件模式?
I'm using setuptools to create an egg and I would like to include some supporting binaries with it, preferably to be installed in the egg directory.
I can include these files with data_files
or package_data
however the executable bit is not set when they are deployed.
Alternatively, I can use scripts
but then they will (by default) be deployed to a common directory that is shared by all other packages, which I would like to avoid.
How can I deploy these binaries with my package and ensure their file modes are preserved?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Linux 中放置支持二进制文件的通常(标准)位置是
/usr/libexec
。因此,您可以使用 data_files 选项在该目录下创建一个目录。在源中使文件 +x 并保留权限。只需在您的设置函数中添加类似的内容,并在项目中添加一个 libexec 目录即可。
The usual (standard) place to put supporting binaries in Linux is in
/usr/libexec
. So you can make a directory under that with the the data_files option. Make the files +x in your source and the permissions should be preserved. Just put something likeIn your setup function, and a
libexec
directory in your project.