Skip to content

Commit

Permalink
Only import keyring if its needed
Browse files Browse the repository at this point in the history
  • Loading branch information
stollero committed Nov 20, 2024
1 parent 1056b7b commit aa81356
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hatch/publish/auth.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import annotations

import keyring

from hatch.utils.fs import Path


Expand Down Expand Up @@ -70,6 +68,8 @@ def __get_username(self) -> str:
return self._app.prompt(f"Username for '{self._repo_config['url']}' [__token__]") or '__token__'

def _read_keyring(self) -> str | None:
import keyring

creds = keyring.get_credential(self._repo, None)
if not creds:
return None
Expand Down

0 comments on commit aa81356

Please sign in to comment.