-
Notifications
You must be signed in to change notification settings - Fork 572
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
Logging fix for hf_api
, logging documentation
#748
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,6 +139,25 @@ def test_login_cli(self): | |
read_from_credential_store(USERNAME_PLACEHOLDER), (None, None) | ||
) | ||
|
||
def test_login_deprecation_error(self): | ||
with pytest.warns( | ||
FutureWarning, | ||
match=r"HfApi.login: This method is deprecated in favor of " | ||
r"`set_access_token` and will be removed in v0.7.", | ||
Comment on lines
+145
to
+146
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is not black formatted. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, it is! I've split it in two to respect the 88 line char limit, black seems okay with it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Black unindented it, the second line was previously indented at the same level as the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK |
||
): | ||
self._api.login(username=USER, password=PASS) | ||
|
||
def test_logout_deprecation_error(self): | ||
with pytest.warns( | ||
FutureWarning, | ||
match=r"HfApi.logout: This method is deprecated in favor of " | ||
r"`unset_access_token` and will be removed in v0.7.", | ||
): | ||
try: | ||
self._api.logout() | ||
except HTTPError: | ||
pass | ||
|
||
|
||
class HfApiCommonTestWithLogin(HfApiCommonTest): | ||
@classmethod | ||
|
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.
Should this information be in README? How are we going to create the documentation for this library? We probably need quite a few user guides and I think this should go in one of those, which probably should be located in the
/doc
folder.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'm putting this here for now, but this should definitely be in a separate guide as outlined in https://github.com/huggingface/huggingface_hub/issues/754