twine.exceptions module#

Module containing exceptions raised by twine.

exception twine.exceptions.TwineException[source]#

Base class for all exceptions raised by twine.

exception twine.exceptions.RedirectDetected[source]#

A redirect was detected that the user needs to resolve.

In some cases, requests refuses to issue a new POST request after a redirect. In order to prevent a confusing user experience, we raise this exception to allow users to know the index they’re uploading to is redirecting them.

classmethod from_args(repository_url: str, redirect_url: str) RedirectDetected[source]#
exception twine.exceptions.PackageNotFound[source]#

A package file was provided that could not be found on the file system.

This is only used when attempting to register a package_file.

exception twine.exceptions.UploadToDeprecatedPyPIDetected[source]#

An upload attempt was detected to deprecated PyPI domains.

The sites and are deprecated.

classmethod from_args(target_url: str, default_url: str, test_url: str) UploadToDeprecatedPyPIDetected[source]#

Return an UploadToDeprecatedPyPIDetected instance.

exception twine.exceptions.UnreachableRepositoryURLDetected[source]#

An upload attempt was detected to a URL without a protocol prefix.

All repository URLs must have a protocol (e.g., https://).

exception twine.exceptions.InvalidSigningConfiguration[source]#

Both the sign and identity parameters must be present.

exception twine.exceptions.InvalidSigningExecutable[source]#

Signing executable must be installed on system.

exception twine.exceptions.InvalidConfiguration[source]#

Raised when configuration is invalid.

exception twine.exceptions.InvalidDistribution[source]#

Raised when a distribution is invalid.

exception twine.exceptions.NonInteractive[source]#

Raised in non-interactive mode when credentials could not be found.

exception twine.exceptions.InvalidPyPIUploadURL[source]#

Repository configuration tries to use PyPI with an incorrect URL.

For example, instead of