英文:
pip install --pre without installing pre-releases for dependencies
问题
有一个名为 A
的包在 PyPI 上,它有一个预发行版本 1.0.0rc1
。
包 A
有一个依赖项,即包 B
,其版本要求为 B >= 1.0.0
,但 B
也有一个预发行版本 1.0.0rc1
,与 A
不兼容。
我希望能够使用 pip install
安装 A
的预发行版本,同时安装 B
的常规(非预发行)版本。
使用 pip install --pre A
似乎会安装 A 1.0.0rc1
和 B 1.0.0rc1
。
对于处理这种情况,是否有建议?以下是我考虑过的几种方法:
- 固定
B==1.0.0
的版本,但这有些限制,并且需要定期更新,以适应B
的新版本发布。 - 告诉用户使用
pip install A==1.0.0rc1
,这样稍微不太方便。
这里的标准方法是什么?谢谢。
英文:
Say I have a package A
on pypi with a pre-release version 1.0.0rc1
.
Package A
has package B
as a dependency with version B >= 1.0.0
, but B
also has a pre-release version 1.0.0rc1
that is incompatible with A
.
I want to be able to pip install the pre-release version of A
while installing the regular (not-pre) release version of B
.
pip install --pre A
seems to install A 1.0.0rc1
and B 1.0.0rc1
.
Are there any recommendations for dealing with this scenario? A few that I've considered
- pin the version of
B==1.0.0
, but this is a bit limiting and requires me to periodically update as new releases ofB
come out. - tell users to
pip install A==1.0.0rc1
, which is slightly less convenient.
What is the standard approach here? Thanks
答案1
得分: 1
这是原始帖子后的很长时间,但我认为这是答案。
要实现您想要的基本上应该使用以下命令:
pip install "A>=1.0.0rc0"
通过在您的版本要求中指定预发行标签,然后pip将允许匹配该要求的预发行和开发版本。
英文:
This is ages after the original post, but i think this is the answer.
Basically to chieve what you want you should use the following
pip install "A>=1.0.0rc0"
by specifying the prerelease tag in your version requirement then pip will allow pre-release and development versions matching for that requirement
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论