requirementslib
requirementslib copied to clipboard
Preserve order of hashes or sort them on write in requirements file
As per reported issue in pipenv https://github.com/pypa/pipenv/issues/5552 there is issue that requirementslib stores hashes in non deterministic order. They should be stored in alphabetic order or in preserve order based on insertion.
Method add_hashes produces a set with no order guarantees. https://github.com/sarugaku/requirementslib/blob/main/src/requirementslib/models/requirements.py#L2427
@matteius already prepared a pull request that sorts hashes on write. https://github.com/sarugaku/requirementslib/pull/357