使用 Distribute 包含包数据
我正在尝试对我的项目的 setup.py
使用 Distribute。我希望它包含包文件夹中的所有文件,这些文件是文本和图像文件,但当然不是 .pyc 文件。我读到这些文件应该由 CVS 和 SVN 跟踪,或者应该有一个 MAINFEST.in
。
所以:
我既不使用 CVS 也不使用 SVN,我使用 git。我知道可以为 git 编写一个插件,也许有人已经这样做了,但我不会使用一些我不知道它是否会被维护和支持的插件。另外,git 跟踪的不仅仅是源文件夹,存储库还包括其他不应打包在发行版中的文件。
我认为 Distribute 的优点之一是不必处理
MANIFEST.in
文件。我真的必须这么做吗?如果是这样,我在哪里可以看到指南?我从未编写过MANIFEST.in
。
有更好的解决方案吗?
I'm trying to use Distribute for my project's setup.py
. I want it to include all the files in the package folder, which are text and image files, but not .pyc files of course. I read that the files should either be tracked by CVS and SVN, or there should be a MAINFEST.in
.
So:
I use neither CVS nor SVN, I use git. I know that it's possible to write a plugin for git, and perhaps someone has, but I'm not going to use some plugin that I don't know if it will be maintained and supported. Also, git is tracking more than the source folder, the repo includes other files which shouldn't be packed in the distribution.
I thought that one of the perks of Distribute is not having to deal with a
MANIFEST.in
file. Do I really have to? If so, where do I see a guide? I've never written aMANIFEST.in
.
Is there any nicer solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经在 Distutils 中更改了该行为(在 Python trunk (2.7/3.2) 中)
现在,默认情况下将包含 package_data 中提到的所有文件,而无需
编写 MANIFEST.in 文件,而无需使用基于 DVCS 的神奇行为。
在那之前,我建议使用显式 MANIFEST.in 并坚持使用普通的 Distutils 选项,这样您就不会依赖任何 VCS,并且不会意外添加文件在您的
存储库,但您不希望看到它添加到您的版本中。
Distribute 0.7.x 可能会坚持使用 Distutils 即将推出的默认行为。
在Distutils文档中查找MANIFEST.in模板语言,它非常简单。
塔雷克
I've change that behavior in Distutils (in Python trunk (2.7/3.2) )
Now all files mentioned in package_data will be included by default without having to
write a MANIFEST.in file, and without having to use the magic behavior based on DVCS.
Until then, I would recommend using an explicit MANIFEST.in and stick with plain Distutils options, so you don't rely on any VCS, and you don't add files by accidents, that are in your
repository, but that you don't want to see added in your release.
Distribute 0.7.x will probably stick with Distutils upcoming default behavior.
Look for the MANIFEST.in template language in the Distutils doc, it's quite simple.
Tarek
我不知道是否有更好的
distribute
文档,因此您可能必须参考 setuptools,distribute
是从中分叉出来的。特别是,请参阅包含数据文件部分。I don't know if there is better documentation yet for
distribute
so you may have to refer to the documentation for setuptools from whichdistribute
was forked. In particular, see the section on Including Data Files.