PyPi: Support package upload
Implement PyPI package upload via the twine
tool.
Details
Upload is performed using the Legacy API using a multipart/form-data
POST request. Details on the fields sent can be found on the referred docs.
The upload process usually involves pushing 2 files, the raw source tar.gz
data and the build distribution file .whl
. Each file is pushed as an independent POST request.
Sample push command:
python3 -m twine upload --repository testpypi dist/*
Entry points
POST gitlab.com/api/v4/projects/:id/packages/pypi
: The upload entry point for twine
.
PUT gitlab.com/api/v4/projects/:id/packages/pypi/authorize
: Internal authentication entry point for workhorse.
Authentication
Needs to support Authentication via basic HTTP auth to allow for either CI tokens or PAT.
See #34161 (closed) for full discussion.
Edited by Giorgenes Gelatti