I'm looking for best practices, do's and don'ts regarding version specifications in requirement's files for pip in python packages.
Assume a python package which depends on some other modules. A minimum version is required for most of them. At least it is know to the maintainers, that the code works with a least, e.g. six 1.7
Now, it is possible to define the requirement in different ways:
six>=1.7.0
The software has been tested with this version and it is assumed that it will also with future versionssix==1.7.0
We require the exact version, the package has been tested with. The software has not been tested with all future versions of the module, thus we can't guarantee it will work for those.six==1.9.0
We just test it with the most recent version and require it.I do have an inhibition to require an exact version, as it may break other packages requirements and seems bad practice for me. On the other hand, the package has not been tested with all versions of six above 1.7.0.
Are there any guidelines regarding package version requirements and the usage of ==
against >=
?
Based on my experience as developer, packager (package maintainer for distributions) and software maintainer I came to the following interpretation / recommendations:
Packagers usually do not use the information from requirements.txt, but from install_requires and extras_requires.