requirementslib icon indicating copy to clipboard operation
requirementslib copied to clipboard

Preserve order of hashes or sort them on write in requirements file

Open matejsp opened this issue 3 years ago • 0 comments

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

matejsp avatar Jan 07 '23 06:01 matejsp