Skip to content

Commit f28c40e

Browse files
committed
Set trusted publishing logging to INFO/WARN
Trusted publishing is the only part of the codebase using `logger.debug()`, which can't be easily accessed from the CLI. This PR changes these to either `logger.info` or `logger.warning()`, such that all are visible with `--verbose`. Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
1 parent 4b6c50b commit f28c40e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

twine/auth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ def make_trusted_publishing_token(self) -> Optional[str]:
9696
)
9797

9898
if oidc_token is None:
99-
logger.debug("This environment is not supported for trusted publishing")
99+
logger.warning("This environment is not supported for trusted publishing")
100100
return None # Fall back to prompting for a token (if possible)
101101

102-
logger.debug("Got OIDC token for audience %s", audience)
102+
logger.info("Got OIDC token for audience %s", audience)
103103

104104
token_exchange_url = f"https://{repository_domain}/_/oidc/mint-token"
105105

@@ -125,7 +125,7 @@ def make_trusted_publishing_token(self) -> Optional[str]:
125125
f"reasons:\n\n{reasons}"
126126
)
127127

128-
logger.debug("Minted upload token for trusted publishing")
128+
logger.info("Minted upload token for trusted publishing")
129129
return cast(str, mint_token_payload["token"])
130130

131131
@property
@@ -179,7 +179,7 @@ def password_from_keyring_or_trusted_publishing_or_prompt(self) -> str:
179179
return password
180180

181181
if self.is_pypi() and self.username == "__token__":
182-
logger.debug(
182+
logger.info(
183183
"Trying to use trusted publishing (no token was explicitly provided)"
184184
)
185185
if (token := self.make_trusted_publishing_token()) is not None:

0 commit comments

Comments
 (0)