Module containing logic for handling settings.
- class twine.settings.Settings#
Object that manages the configuration for Twine.
This object can only be instantiated with keyword arguments.
Will raise a
TypeError. Instead, you would want
- __init__(*, sign: bool = False, sign_with: str = 'gpg', identity: str | None = None, username: str | None = None, password: str | None = None, non_interactive: bool = False, comment: str | None = None, config_file: str = utils.DEFAULT_CONFIG_FILE, skip_existing: bool = False, cacert: str | None = None, client_cert: str | None = None, repository_name: str = 'pypi', repository_url: str | None = None, verbose: bool = False, disable_progress_bar: bool = False, **ignored_kwargs: Any) None #
Initialize our settings instance.
sign – Configure whether the package file should be signed.
sign_with – The name of the executable used to sign the package with.
identity – The GPG identity that should be used to sign the package file.
username – The username used to authenticate to the repository (package index).
password – The password used to authenticate to the repository (package index).
non_interactive – Do not interactively prompt for username/password if the required credentials are missing.
comment – The comment to include with each distribution file.
config_file – The path to the configuration file to use.
skip_existing – Specify whether twine should continue uploading files if one of them already exists. This primarily supports PyPI. Other package indexes may not be supported.
cacert – The path to the bundle of certificates used to verify the TLS connection to the package index.
client_cert – The path to the client certificate used to perform authentication to the index. This must be a single file that contains both the private key and the PEM-encoded certificate.
repository_name – The name of the repository (package index) to interact with. This should correspond to a section in the config file.
repository_url – The URL of the repository (package index) to interact with. This will override the settings inferred from
verbose – Show verbose output.
disable_progress_bar – Disable the progress bar.
- _allow_noninteractive() AbstractContextManager[None] #
Bypass NonInteractive error when client cert is present.
- static register_argparse_arguments(parser: ArgumentParser) None #
Register the arguments for argparse.
- check_repository_url() None #
Verify we are not using legacy PyPI.
twine.exceptions.UploadToDeprecatedPyPIDetected – The configured repository URL is for legacy PyPI.