Issue Description
JFrog provides a Nexus migration tool to help users migrate artifacts from Nexus to Artifactory. However, when migrating PyPI artifacts from Nexus to Artifactory, clients may encounter an issue that the download of PyPI artifacts fails.
This issue is caused by the inconsistency between the directory structures of PyPI artifacts stored in Nexus and those stored in Artifactory. When migrating from Nexus to the Artifactory PyPI repository, a layer of directories named 'package' is added by default, which prevents clients from downloading PyPI packages correctly.
- Nexus PyPI location example:
- Artifactory PyPI location example after migration:
- It will return the 404 error when the client attempts to download the package from Artifactory.
Resolution
We can copy the artifacts from the package directory to the PyPI repository's root directory using the JFrog CLI cp command. An example is as follows:
# add the Artifactory service in the client:
jf c add <server-id> --url=<JFrog Platform URL> --user=<username> --password=<password> --interactive=false
# use the added Artifactory service:
jf c use <server-id>
# test the Connection:
jf rt ping
# copy the pypi artifactes to the root dir
jf rt cp "test-pypi/packages/(*)" test-pypi/{1}
Running the download test in the client:
pip3 install pathlib2
We can delete the package directory after the test has been completed successfully.