Python 制作系统
各种类似 Python make
的系统有哪些优点和问题?
注意我们在列表项的开头分别使用符号“(+)”和“(-)”来表示好处和问题。
到目前为止,我知道
- buildit
- 以前称为
pymake
- (-) 似乎已过时:最后一次发布是在 2007 年底
- 以前称为
- zc.buildout
- (+) 目前处于活动状态,截至 2010 年 7 月 20 日
- 使用类似于 rc 文件的语法与
[sections]
- (-) python 代码无法(?)轻松集成到配置文件中。
- 似乎非常重视使用
.egg
文件。
- scons
- (+) 目前处于活动状态,截至 2010 年 7 月 20 日
- 配置文件是用纯Python编写的
- (+) python 代码可以轻松集成到配置文件中
- (-)?使用 Python 作为配置文件可能会导致额外的冗长
- waf
- (+)? Mark 说“好处与
scons
一样,但是更快” - 有什么缺点吗?为什么人们仍在使用
scons
?
- (+)? Mark 说“好处与
What are the benefits and problems with the various Python make
-like systems?
note We're using the denotations '(+)' and '(-)' respectively at the beginning of list items to indicate benefits and problems.
So far I'm aware of
- buildit
- was previously known as
pymake
- (-) seems to be obsolescing: last release was in late 2007
- was previously known as
- zc.buildout
- (+) currently active as of 2010-07-20
- uses rc-file-like syntax with
[sections]
- (-) python code cannot (?) readily be integrated into config files.
- seems to place a lot of emphasis on working with
.egg
files.
- scons
- (+) currently active as of 2010-07-20
- configuration files are written in pure Python
- (+) python code can readily be integrated into config files
- (-)? use of Python for config files may entail extra verbosity
- waf
- (+)? Mark says "Benefits as
scons
but faster" - Any downsides? Why are people still using
scons
?
- (+)? Mark says "Benefits as
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
WAF 的一个怪癖是它应该被复制到程序的源代码树中。 Scons 更像 make,因为它在系统上安装一次,然后在源代码树中基本上只有一个数据文件(以 python 程序的形式)。
因此,Scons 是在 Ubuntu/Debian 上打包的,而 waf 不是。
在 Scons 中进行元编程来操作依赖图或添加新的推导概念是可能的,但有点困难。显然waf在这方面做得更好。
我已经愉快地使用过Scons很多次了;对于我的下一个编译项目,我可能至少会尝试 waf。
您可以阅读Samba 使用 Waf 的经验。他们报告说,从 autoconf 到 Waf 正确设置了 rpath,并通过每个程序仅链接一次必要的目标文件来缩小二进制文件。
One quirk of waf is that it's supposed to be copied into the source tree of the program. Scons is a lot more like make in that it's installed once on the system, and then you have essentially just a data file (in the form of a python program) in the source tree.
As a consequence, Scons is packaged on Ubuntu/Debian and waf is not.
It's possible but a bit hard in Scons to do metaprogramming that manipulates the dependency graph or adds new concepts for derivation. Apparently waf is better at that.
I have used Scons happily many times; for my next compiled project I will probably at least try waf.
You can read about Samba's experience with waf. They report that going from autoconf to Waf got the rpaths set correctly and shrunk the binaries by linking the necessary object files exactly once per program.
以下是截至 2015 年 5 月 31 日为止 Python 3 的 4 个软件构建系统的状态。
Here is the status of 4 of the software build systems for Python 3, as of 2015-05-31.
当我大约 1.5-2 年前使用 waf 时,它的文档非常稀疏且糟糕,这极大地限制了它的实用性。不过,我已经有一段时间没有使用 waf 了,所以也许情况已经改变了。
When I used waf about 1.5-2 years ago, it had really sparse and poor documentation which greatly limited its utility. I haven't used waf in a while, though, so maybe that situation has changed.