如何在它的 trunk 版本中安装 Python Babel 库?
经过几个小时的查找为什么我的 Babel 安装中缺少一些已记录的功能后,我了解到有Babel 开发的两个分支:
Babel 有两条独立的开发路径(0.9.x 分支和主干) 尽管很少有开发人员致力于此,但并行已经有大约 4 年了 该项目。我们尝试通过发布稳定的版本来解决这种情况 1.0 版本,但是现实生活并不总是对开源贡献友好。
Babel 的常见问题解答证实了这一点。我想在我的项目中使用 Flask-Babel 。 setup.py
中的依赖项表示我只需要 Babel
。这意味着我的 pip
采用我的环境中安装的任何版本或搜索 PyPI 的最新版本,其中 是版本0.9.6。不合逻辑的是,Flask-Babel 使用了 0.9.x 分支中不存在的函数。也许我遗漏了一些东西,也许我只是很困惑,但是如何轻松安装主干版本,最多的新功能在哪里?我怎样才能在我的 setup.py
中强制使用这样的版本?这对于使用 Flask-Babel 的人来说是如何工作的? (我知道,最后一个问题是 Flask 特定的,应该去这里,但所有其他问题可以回答其他人。)
谢谢您的任何建议。大胆的问题是最重要的,其余的都是 Flask-Babel 特有的“很高兴拥有”。
After hours of finding out why there are missing some documented functions in my Babel installation, I learned there are two branches of Babel development:
Babel has two separate development paths (0.9.x branch and trunk) in
parallel for about 4 years now despite very few developers working on
the project. We try to resolve that situation by releasing a stable
1.0 version but well, real live is not always friendly to open source contribution.
Babel's FAQ confirms that. I want to use Flask-Babel in my project. It's dependency in setup.py
says I need just Babel
. It means my pip
takes any version installed in my environment or searches PyPI for the newest version, where is version 0.9.6. Unlogically, Flask-Babel uses functions which are not present in 0.9.x branch. Maybe I am missing something, maybe I am just confused, but how can I easily install the trunk version, where is the most of new features? And how can I enforce using such a version in my setup.py
? How it all works for the people who use Flask-Babel? (I know, the last question is rather Flask-specific and should go here, but all the other questions can answer anyone else.)
Thank you for any suggestions. The bold questions are the most important, the rest is rather Flask-Babel-specific "nice to have".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过使用
pip
以及您需要的分支的 url ?之后,
pip
应该对依赖项感到满意:关于如何在
setup.py
中强制依赖项。由于您已经在使用pip
,因此您可以尝试 需求文件。Have you tried using
pip
with the url to the branch that you need?After that,
pip
should be happy with the dependency:Regarding how to force a dependency in you
setup.py
. Since you're already usingpip
, you can give a try to a requirements file.