Skip to content

Commit

Permalink
Default username to '__token__' if not specified.
Browse files Browse the repository at this point in the history
Closes #1121
  • Loading branch information
jaraco committed Jun 26, 2024
1 parent 7386ee0 commit b093a57
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions twine/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def choose(cls, interactive: bool) -> Type["Resolver"]:
@property
@functools.lru_cache()
def username(self) -> Optional[str]:
if self.is_pypi():
# Username is invariant.
return "__token__"
if self.is_pypi() and not self.input.username:
# Default username.
self.input.username = "__token__"

return utils.get_userpass_value(
self.input.username,
Expand Down

0 comments on commit b093a57

Please sign in to comment.