Re:An analysis of module names inside top PyPI packages
by woodruffw on Wednesday July 10, 2024 @09:44PM
(#40933095)
> I _think_ it's because there a bdist in PyPI for one, and not the other, so `pip` is using different "backends" that normalize the names into `METADATA` differently... ugh.
That isn't why: it's because `cast-from-env`'s sdist is from March 2023, while PEP 625 (which strongly stipulates package name normalization) was adopted in setuptools a year later[1].
But to take a step back: why does the difference in `pip freeze` affect you? It shouldn't matter to `pip`, since PyPI will happily serve from both the normalized and unnormalized names.
https://pypi.org/project/xml-from-seq/ → xml_from_seq
https://pypi.org/project/cast-from-env/ → cast_from_env
Simple normalization, right? But `pip` installs one with underscores and one with dashes:
so that's what ends up in `pip freeze`.I _think_ it's because there a bdist in PyPI for one, and not the other, so `pip` is using different "backends" that normalize the names into `METADATA` differently... ugh.