Use PyPI File Path Name Normalization

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

The PyPI File Path Name Normalization feature brings Artifactory closer in alignment with the PyPI.org registry. This feature helps you keep a consistent naming method for PyPI artifacts to reduce potential package name duplications due to the use of non-normalized characters. JFrog recommends using this feature alongside PyPI Enforce Layout. For more information, see Use PyPI Enforce Layout and Using Both PyPI File Path Name Normalization and Enforce Layout.

PyPI Enforce Layout is available in Artifactory starting from version 7.70.2.

Backward Compatibility

File Path Name Normalization applies to all PyPI repositories in your Artifactory instance, previously uploaded packages that already exist in your instance will not be updated but if you attempt to upload a newer version or overwrite an existing one you will be prevented from doing so since the file path name does not conform to the normalization rules.

When this feature is enabled, Artifactory blocks the deployment of files with path name/distribution values that do not conform to the PyPI standard naming conventions, as specified in the Python documentation pages Source Distribution File Name and File Format.

{NAME}-{VERSION}-{OPTIONAL-PARAMETERS}.tar.gz
{DISTRIBUTION}-{VERSION}-{OPTIONAL-PARAMETERS}.whl

The most common example of how this feature provides value is the prevention of Dash (-) that is considered a Reserved Character between the different segments of the naming path (name/distribution, version, optional parameters, etc.) from being used within the name/distribution segment.

For example, see whether different names would be allowed when File Path Name Normalization is enabled:

Normalization_table.png

To enable PyPI File Path Name Normalization, in the artifactory.system.properties settings file set the system property:

artifactory.pypi.enforce.naming.normalization = true 

Artifactory will return an error when trying to perform actions on an artifact whose name does not match the naming conventions, with a description of the issue:

Error

Description

403

Action prevented due to artifact file name normalization requirements - artifact name <ARTIFACT_NAME> does not conform to normalized requirements