Use PyPI File Path Name Normalization

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide

The PyPI File Path Name Normalization feature brings Artifactory closer in alignment with the PyPI.org registry by enforcing a consistent naming method for PyPI artifacts, which reduces potential package name duplications due to the use of non-normalized characters.

JFrog recommends using this feature in conjunction with PyPI Enforce Layout. For more information, see Use PyPI Enforce Layout and Using Both PyPI File Path Name Normalization and Enforce Layout.Use PyPI Enforce LayoutUsing Both PyPI File Path Naming 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 standard PyPI naming conventions, as specified in the Python documentation pages (see 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 the dash (-), which 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.

The table below describes which 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 following 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