PyPi: Support package installation
Details
Package installation is done using the Legacy Simple API.
Sample command:
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps <package-name>
This command makes 2 request, the first is a GET /simple/<package-name>
, which returns a HTML with links to the packages for each version. The second request is simply a GET
to download the proper distribution file.
A sample request and response can be found in the docs.
Entry Points
GET gitlab.com/api/v4/projects/:id/packages/pypi/simple/<package-name>
: The entry point to get the meta data about the package with the list of versions and files to download.
GET gitlab.com/api/v4/packages/pypi/<file-identifier>
: The url to download the package file.
Authentication
Needs to support Authentication via basic HTTP auth to allow for either CI tokens or PAT.
See #34161 (closed) for full discussion.