Requirements.txt 大于等于然后小于?
Requirements.txt greater than equal to and then less than?
我的需求文件中有这一行
django>=1.10,<1.11
这是否意味着我需要 Django 版本 >= 1.10
然后低于 1.11
?
是。 pip manual [doc] has a section on the format of "requirement specifiers". These are documented in PEP-508 [pep] and PEP-440 [pep]:
The comparison operator determines the kind of version clause:
~=
: Compatible release clause
==
: Version matching clause
!=
: Version exclusion clause
<=
, >=
: Inclusive ordered comparison clause
<
, >
: Exclusive ordered comparison clause
===
: Arbitrary equality clause.
The comma (","
) is equivalent to a logical and operator: a candidate version must match all given version clauses in order to match the specifier as a whole.
所以在你的情况下,这意味着 Django 版本是 1.10
或更高版本而不是 1.11
或更高版本(所以 1.10
很好,1.10.1
,以及, 但不是 1.11
、1.11.1
或 2.0.1
).
我的需求文件中有这一行
django>=1.10,<1.11
这是否意味着我需要 Django 版本 >= 1.10
然后低于 1.11
?
是。 pip manual [doc] has a section on the format of "requirement specifiers". These are documented in PEP-508 [pep] and PEP-440 [pep]:
The comparison operator determines the kind of version clause:
~=
: Compatible release clause==
: Version matching clause!=
: Version exclusion clause<=
,>=
: Inclusive ordered comparison clause<
,>
: Exclusive ordered comparison clause===
: Arbitrary equality clause.The comma (
","
) is equivalent to a logical and operator: a candidate version must match all given version clauses in order to match the specifier as a whole.
所以在你的情况下,这意味着 Django 版本是 1.10
或更高版本而不是 1.11
或更高版本(所以 1.10
很好,1.10.1
,以及, 但不是 1.11
、1.11.1
或 2.0.1
).