This is my attempt to prevent anyone else from being bitten by this change:
auth.py
def username(self) -> Optional[str]:
if cast(str, self.config["repository"]).startswith(
(utils.DEFAULT_REPOSITORY, utils.TEST_REPOSITORY)
):
# As of 2024-01-01, PyPI requires API tokens for uploads, meaning
# that the username is invariant.
return "__token__"
Show how to use twine+keyring post 2024-01-01.
This is my attempt to prevent anyone else from being bitten by this change:
auth.py