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 authored and sigmavirus24 committed Oct 5, 2024
1 parent b340fa6 commit 40f4657
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 40f4657

Please sign in to comment.