Commit Graph

6 Commits

Author SHA1 Message Date
Jeremy Stanley 4a04383076 pypi-upload: support twine --skip-existing option
Warehouse (the software implementing the PyPI service) expressly
disallows reuploading any file which is already present, and returns
an error if you attempt to do so. Under normal circumstances this is
desirable feedback, but if you're using this role to upload a batch
of files and encounter a network or service error partway through,
you can be left in a position where it's impossible to rerun the job
for those same artifacts later in order to correct the issue.

Add a pypi_twine_skip_existing boolean toggle to the pypi-upload
role, which will allow callers to indicate to twine that errors from
PyPI indicating a file is already present are to be treated as a
non-fatal condition so that it can proceed with uploading any which
do exist. Set its default to false, preserving the existing behavior
for the sake of backward compatibility.

In addition to the previously stated use case, this also makes it
possible to build different architecture-specific wheels in separate
jobs without needing to worry about deciding which one will include
the sdist, since they can all try to upload it safely.

Change-Id: I66a8ffce47eb5e856c3b481c20841b92e060b532
2022-11-08 13:26:22 +00:00
Ian Wienand 2c58a8ceed upload-pypi: support API token upload
Support an api_token argument.  Accounts that have two-factor auth
will at some point require using API tokens to upload.

Change-Id: Id0c47d088d6e8febbae3c96caecc81ebe247754e
2022-07-13 15:18:08 +10:00
mhuin fa9cb2f468 upload-pypi: add option to register packages
When uploading packages to a devPI instance, the role fails if
the packages are not registered first. Since this is not required
on PyPI, this adds the "pypi_register_first" option to the role
so that users can choose to do so.

Change-Id: I2b50362e485175d51840e49ffc09a734b44ec85d
2019-01-08 07:49:43 +00:00
James E. Blair a1c25d6fc8 upload-pypi: make repository url optional
The current default URL returns an error.  The error message suggests
that we just omit the URL entirely from the config and let twine
handle it.  That's what this patch does.

Change-Id: I83b2eb30e3c93690dbe03052cd3f20a73c110350
2017-10-17 14:13:24 -07:00
Paul Belanger d292ee658a
Create pypi_twine_executable
Like we do for bindep and tox roles. Allow a user to manage the twine
binary outside of the upload-pypi role. This allows a user to better
control the path of the executable too.

Change-Id: I5c757b29e185ab76495abf3cfb2d853aada77a50
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-08-23 15:21:26 -04:00
Paul Belanger f94b0b809d
Add upload-pypi role
Create a role to upload python artificats using twine

username and password are required, so remove them from
defaults. Install twine in the homedir by default if the twine command
is not found.

Upload wheels if found first, then tarballs.
Change-Id: I8857e2983e1175107164536d57e313a5b404bddb
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-08-22 16:08:09 -04:00