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

Don't correct case insensitive differences #94

Closed peterbe closed 5 years ago

peterbe commented 5 years ago

At some point, this requirements file, for some reason, had unipath in it. The correct name is Unipath.

hashin shouldn't fix that when you use the --update-all flag.

▶ python hashin.py -r ~/songsearch/requirements.txt --dry-run --update-all

--- Old
+++ New
@@ -6,9 +6,9 @@
     --hash=sha256:851785365761ebe4994a921b433062309eb882fedd318e1b0fcecc607ed02da9
 python-decouple==3.1 \
     --hash=sha256:1317df14b43efee4337a4aa02914bf004f010cd56d6c4bd894e6474ec8c4fe2d
-unipath==1.1 \
-    --hash=sha256:e6257e508d8abbfb6ddd8ec357e33589f1f48b1599127f23b017124d90b0fff7 \
-    --hash=sha256:09839adcc72e8a24d4f76d63656f30b5a1f721fc40c9bcd79d8c67bdd8b47dae
+Unipath==1.1 \
+    --hash=sha256:09839adcc72e8a24d4f76d63656f30b5a1f721fc40c9bcd79d8c67bdd8b47dae \
+    --hash=sha256:e6257e508d8abbfb6ddd8ec357e33589f1f48b1599127f23b017124d90b0fff7
 requests==2.20.0 \
     --hash=sha256:99dcfdaaeb17caf6e526f32b6a7b780461512ab3f1d992187801694cba42770c \
     --hash=sha256:a84b8c9ab6239b578f22d1c21d51b696dcfe004032bb80ea832398d6909d7279
peterbe commented 5 years ago

Note, in the diff output, the order of the hashes is just reversed. That's going to be tackled by https://github.com/peterbe/hashin/issues/93

peterbe commented 5 years ago

Actually, I'm not so sure this is worth it. It is a correction after all. And the fact that the --update-all flag was used is not available near the code where that'd be used.

peterbe commented 5 years ago

It's actually not got anything to do with case sensitivity. It happens any time you have written the "wrong" name in the requirements file. For example, discogs-client used to be called discogs_client (with an underscore) but that now redirects to discogs-client.

If you had a name in your requirements file that now causes a redirect in Pypi I think that's a good thing that the --update-all fixes it.