The PyPI Enforce Layout feature ensures that uploaded packages adhere to a standardized physical directory structure, filenames, and internal metadata, to promote a consistent and compliant repository.
JFrog recommends using this feature in conjunction with File Path Name Normalization. For more information, see Use File Path Name Normalization and Using Both File Path Name Normalization and Enforce Layout.
PyPI Enforce Layout is available in Artifactory starting from version 7.70.2.
Backward Compatibility
Enforce Layout 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 sections must match the metadata values.
This feature enables you to restrict uploads to artifacts where the file name and version in the path match the package name and version stored in the artifact’s metadata.
The following examples explain how this feature applies without File Path Name Normalization:
To enable PyPI Enforce Layout, in the artifactory.system.properties settings file set the system property:
artifactory.pypi.enforce.layout = true
Artifactory will return an error when trying to perform actions on an artifact with a name that does not match the package metadata, with a description of the issue:
Error | Description |
|---|---|
403 |
|
403 |
|