acsone/setuptools-odoo

Generate requirements: duplicated entries when specific version pinned

Closed this issue · 3 comments

Does this cause issues in practice ?

The final result seems correct anyway but in the case of lower pinning you get 2 downloads. Eg:

$ cat test-bad-requirements.txt 
apispec
apispec<5.1.0

$ pip install -r test-bad-requirements.txt --no-cache-dir
Collecting apispec
  Downloading apispec-5.1.0-py2.py3-none-any.whl (28 kB)
  Downloading apispec-5.0.0-py2.py3-none-any.whl (28 kB)
Installing collected packages: apispec
Successfully installed apispec-5.0.0

Greater pinning (same case as base_rest):

$ cat test-bad-requirements.txt 
apispec
apispec>=4.0.0

$ pip install -r test-bad-requirements.txt --no-cache-dir
Collecting apispec
  Downloading apispec-5.1.0-py2.py3-none-any.whl (28 kB)
Installing collected packages: apispec
Successfully installed apispec-5.1.0

So, not really harmful, but still weird and sub-optimal if we have many duplicated entries.
In fact, this does not happen that often...

Yep, the pip resolver is correctly handling these cases. This would be hard to "fix" for little benefit. Moreover when mixing requirements.txt from different repos people still need to rely on pip to resolve correctly. So closing.