Open techtonik opened 5 years ago
The reason is because that functionality simply doesn't exist. What we'd need is to write some code that downloads all possible versions of pytest
and then, using the operator, calculate what the best version would be.
E.g. ["3.9.8", "3.9.9", "4.0.0", "4.1"] ==> 3.9.9
In a sense, it already supports
$ hashin.py -r requirements_dev.txt "pytest>=4.0.0"
because if you omit the operator (or the version) it knows to pick the latest and greatest which is a lot easier to compute.
If you feel like you often need to add a version with an operator other than >=
or ==
then I think it's pretty straight forward to add.
Also, doing that kind of version operation arithmatic "should be easy" if done using pip
's underlying tools and functions.
I thought that it should somehow be done through the imported pip_api
, but I don't know if I will need it second time. Right now hierarchical dependency updates are more useful and fun for learning pip_api
.
Perhaps because I've been lazy but there's been a couple of times where I know I don't want the latest version. For example, when I upgrade or add a lib in a Python2 project. Then I usually, for example, open the CHANGELOG.rst and read it for which version is right for my project. It might, for example, say that "As of version 2.0.0 it only works for Python3". So I figured out I need version ==1.9.3
and then I go to use hashin
.
For some reason there is an assertion against using
<
is package specifier.