Requirements.txt greater than equal to and then less than?

PythonDjangorequirements.txt

Python Problem Overview


I have this line in my requirements file

django>=1.10,<1.11

Does that mean I need to have Django version >= 1.10 and then less than 1.11?

Python Solutions


Solution 1 - Python

Yes. The 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: > > 1. ~=: Compatible release clause > 2. ==: Version matching clause > 3. !=: Version exclusion clause > 4. <=, >=: Inclusive ordered comparison clause > 5. <, >: Exclusive ordered comparison clause > 6. ===: 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.

So in your case it means that the Django version is 1.10 or higher and not 1.11 or higher (so 1.10 is fine, 1.10.1, as well, but not 1.11, 1.11.1, or 2.0.1).

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionChrisView Question on Stackoverflow
Solution 1 - PythonWillem Van OnsemView Answer on Stackoverflow