-
-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support username and password from keyring #1734
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry that i missed this aspect back then. from looking at Github's web ui this lgtm. @ofek, would it be of help for you if i had a closer look with an IDE on this?
Yes please |
class MockKeyring: | ||
@staticmethod | ||
def get_credential(*_): | ||
class Credential: | ||
username = 'gat' | ||
|
||
return Credential() | ||
|
||
@staticmethod | ||
def get_password(*_): | ||
return 'guido' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have no strong opinion on this, but it would imo make sense to
a) realize this as a test fixture that is automatically used on all tests in this module.
b) add the password
attribute to the Credential
dummy.
@@ -72,6 +73,12 @@ def __get_username(self) -> str: | |||
self.__username_was_read = True | |||
return self._app.prompt(f"Username for '{self._repo_config['url']}' [__token__]") or '__token__' | |||
|
|||
def _read_keyring(self) -> str | None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could also store the __password
property as i'm assuming that using a username from this credentials source doesn't make sense with a password from another source.
Hello everyone,
this brings back the enhancement added with #713 that broke with f59508b.
Had minor problems getting the tests to run because https://hatch.pypa.io/latest/community/contributing/ is outdated, but https://github.com/pypa/hatch/blob/master/docs/community/contributing.md worked 👍.