Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Artifact Registry Remote PyPi Repository Version Requirements

Hello! I have a question regarding the Python version constraints in the Artifact Registry remote PyPI repositories.

We wanted to leverage the remote PyPI repo in order to speed up our builds. However we faced an issue that prevents us from using it. It seems that Artifact Registry doesn't know about the Python version requirements of the packages hence sometimes pip tries to install unsupported versions and eventually fails.

For example, we are on Python 3.8 and we want to install numpy. The latest version that supports Python 3.8 is 1.24.4 and that is what you get when you run pip install numpy without Artifact Registry. But if you use an Artifact Registry remote repo and run the same command, pip will try to install the latest possible version - 1.26.4 and will fail because this version doesn't support Python 3.8.

For me, it seems that Artifact Registry doesn't copy the package metadata when caching the packages. For example, if you run curl https://pypi.org/simple/numpy/  you will get a list of all the available packages and they all have an HTML attribute data-requires-python. When you run the same command over the Artifact Registry remote repo, it will return a similar list but without the data-requires-python attribute.

My question is: is it a bug or a feature and are there any ways on how to overcome this problem?

Thanks.

0 0 452
0 REPLIES 0