packaging.python.org
packaging.python.org copied to clipboard
Extract rules for normalising components of filenames
The wheel spec contains the rules for normalising distribution name and version for use in a filename (which involves ensuring hyphens are replaced by underscores, so we can use hyphens to separate parts of filenames). PEP 625 uses the same rules (by reference) for source distributions, and in general having a "filename-safe" normalisation rule is potentially useful in other circumstances.
We should split out the normalisation rules into a separate document, keeping it under "Package Distribution File Formats" as it's a form of file format specification. It might also be worth putting the "PEP 503 normalisation" rule in this same section, so we can refer to it as a standard rather than as part of a PEP.
Ideally, we should take the time to tidy up the wording, particularly of the distribution name normalisation rule, as this has proved easy to misinterpret in the past. But if we do this, we should be careful not to nadvertantly change the meaning (as such a change would not be a simple textual clarification, and so would need approval and possibly a PEP).