Here’s an example: Let’s say you uploaded a package to your local PyPi repository, named hello1234, version 0.0.1. In the remote PyPi repository, there’s a version 0.0.2 of this package. If you perform the pip install hello1234 command, you should find that Artifactory will go to the remote repository and fetch version 0.0.2:
Now take a look in the cache and you should see that the metadata file is located in a folder named .pypi and is called hello1234.html. What you’d want to do next is to place the following exclude pattern in the remote repository: .pypi/hello1234.*. This will block the metadata file from being downloaded and clear the cache. When pip install hello1234 command is performed again, you should see that version 0.0.1 has been fetched from the local repository:
NOTE: Regardless of their names, all metadata files are saved with lowercase letters. Accordingly, include/exclude patterns must always be in lowercase. For example, to exclude the package named HAL (written with all uppercase letters in the remote repository), you will need to set your exclude pattern as .pypi/hal.*. And upon executing this command, keep your fingers crossed that the result that comes back isn’t a message reading, "I’m sorry, Dave, I’m afraid I can’t do that." ☺
Now take a look in the cache and you should see that the metadata file is located in a folder named .pypi and is called hello1234.html. What you’d want to do next is to place the following exclude pattern in the remote repository: .pypi/hello1234.*. This will block the metadata file from being downloaded and clear the cache. When pip install hello1234 command is performed again, you should see that version 0.0.1 has been fetched from the local repository:
NOTE: Regardless of their names, all metadata files are saved with lowercase letters. Accordingly, include/exclude patterns must always be in lowercase. For example, to exclude the package named HAL (written with all uppercase letters in the remote repository), you will need to set your exclude pattern as .pypi/hal.*. And upon executing this command, keep your fingers crossed that the result that comes back isn’t a message reading, "I’m sorry, Dave, I’m afraid I can’t do that." ☺