对于如何正确地声明Python包的需求,我有些困惑。在
未正式发布的新版本确实具有预发布名称,如0.2.3.dev20160513165655
。在
当我们添加--pre
选项并且在构建开发分支时,pip安装预发行版是非常明智的。主分支不使用它。在
我发现,如果我把foobar>=0.2.3
放在一个需求文件中,即使我指定了--pre参数,也不会选择开发版本。在
pip documentation在这里没有太大帮助,因为它没有指出任何关于预发布的内容。在
我使用了放置foobar>0.2.2
的方法,它与{
即使这有点缺陷,因为如果我们发布一个像0.2.2.1
这样的修补程序,它可能已经选择了它。在
那么,最好的解决方法是什么呢?在
旁注:当我们发布一个版本(从开发到主版本的拉式请求)时,最好不要对需求文件进行修补。请记住,developbranch总是使用--pre
,而master没有
如果其他人遇到这个问题,答案是in the same documentation:
因此,指定
>=0.2.3.dev0
或类似名称应该选择“最新”的预发行版。在请注意,如果您已经发布了
0.2.3
,那么它将总是比预发布(如0.2.3.dev20160513165655
)排序为“更新”。PEP 440表示以下内容:它还说:
所以理想情况下,您不使用日期戳,而是使用
dev1
,dev2
,dev3
。我认为政治公众人物实际上是说你应该使用0.2.3.dev1
,0.2.4.dev1
,0.2.5.dev1
,但两者都是同样可读的。这实际上取决于您正在生成多少个构建。在在您的例子中,如果}就会认为它是更新的。在
0.2.3
已经发布,那么所有后续的开发版本都需要是0.2.4.dev20160513165655
,这样{相关问题 更多 >
编程相关推荐