peterbe / hashin

Helping you write hashed entries for packages in your requirements.txt
https://www.peterbe.com/plog/hashin
MIT License
105 stars 27 forks source link

-u doesn’t update all? #139

Open jenstroeger opened 2 years ago

jenstroeger commented 2 years ago

Thank you for this useful tool!

Without digging deeper, I just noticed that given a fresh requirements.txt file (i.e. without any hashes) the -u doesn’t actually add hashes to all entries. Seemingly random ones are left out, but when I run them in the command line they’re added to the requirements.txt just fine… 🤔 That’s in both synchronous download mode, and parallel.

Have you noticed that behavior?

For the time being I use

touch requirements.txt  # Because the file needs to exists, else hashin fails.
for p in `pip list --format freeze`; do hashin --verbose $p; done

which adds the hashes for all of the packages listed in requirements.txt.