Skip to content

Commit bbf5a67

Browse files
committed
Pushback deprecation for v0.7 release (#882)
1 parent ff749a8 commit bbf5a67

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/huggingface_hub/hf_api.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
logger = logging.get_logger(__name__)
5656

5757

58-
# TODO: remove after deprecation period is over (v0.7)
58+
# TODO: remove after deprecation period is over (v0.8)
5959
def _validate_repo_id_deprecation(repo_id, name, organization):
6060
"""Returns (name, organization) from the input."""
6161
if repo_id and not name and organization:
@@ -78,7 +78,7 @@ def _validate_repo_id_deprecation(repo_id, name, organization):
7878
elif name or organization:
7979
warnings.warn(
8080
"`name` and `organization` input arguments are deprecated and "
81-
"will be removed in v0.7. Pass `repo_id` instead.",
81+
"will be removed in v0.8. Pass `repo_id` instead.",
8282
FutureWarning,
8383
)
8484
else:
@@ -558,7 +558,7 @@ def login(self, username: str, password: str) -> str:
558558
559559
<Tip>
560560
561-
Warning: Deprecated, will be removed in v0.7. Please use
561+
Warning: Deprecated, will be removed in v0.8. Please use
562562
[`HfApi.set_access_token`] instead.
563563
564564
</Tip>
@@ -583,7 +583,7 @@ def login(self, username: str, password: str) -> str:
583583
"""
584584
warnings.warn(
585585
"HfApi.login: This method is deprecated in favor of `set_access_token`"
586-
" and will be removed in v0.7.",
586+
" and will be removed in v0.8.",
587587
FutureWarning,
588588
)
589589
path = f"{self.endpoint}/api/login"
@@ -651,7 +651,7 @@ def _validate_or_retrieve_token(
651651
token (``str``, `optional`):
652652
Hugging Face token. Will default to the locally saved token if not provided.
653653
name (``str``, `optional`):
654-
Name of the repository. This is deprecated in favor of repo_id and will be removed in v0.7.
654+
Name of the repository. This is deprecated in favor of repo_id and will be removed in v0.8.
655655
function_name (``str``, `optional`):
656656
If _validate_or_retrieve_token is called from a function, name of that function to be passed inside deprecation warning.
657657
Returns:
@@ -690,7 +690,7 @@ def logout(self, token: Optional[str] = None) -> None:
690690
691691
<Tip>
692692
693-
Warning: Deprecated, will be removed in v0.7. Please use
693+
Warning: Deprecated, will be removed in v0.8. Please use
694694
[`HfApi.unset_access_token`] instead.
695695
696696
</Tip>
@@ -702,7 +702,7 @@ def logout(self, token: Optional[str] = None) -> None:
702702
"""
703703
warnings.warn(
704704
"HfApi.logout: This method is deprecated in favor of `unset_access_token` "
705-
"and will be removed in v0.7.",
705+
"and will be removed in v0.8.",
706706
FutureWarning,
707707
)
708708
if token is None:

src/huggingface_hub/utils/_deprecation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
from inspect import Parameter, signature
44

55

6-
def _deprecate_positional_args(func=None, *, version="0.7"):
6+
def _deprecate_positional_args(func=None, *, version="0.8"):
77
"""Decorator for methods that issues warnings for positional arguments.
88
Using the keyword-only argument syntax in pep 3102, arguments after the
99
* will issue a warning when passed as a positional argument.
1010
1111
Args:
1212
func (``Callable``, `optional`):
1313
Function to check arguments on.
14-
version (``Callable``, `optional`, defaults to ``"0.7"``):
14+
version (``Callable``, `optional`, defaults to ``"0.8"``):
1515
The version when positional arguments will result in error.
1616
"""
1717

tests/test_hf_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,15 @@ def test_login_deprecation_error(self):
161161
with pytest.warns(
162162
FutureWarning,
163163
match=r"HfApi.login: This method is deprecated in favor of "
164-
r"`set_access_token` and will be removed in v0.7.",
164+
r"`set_access_token` and will be removed in v0.8.",
165165
):
166166
self._api.login(username=USER, password=PASS)
167167

168168
def test_logout_deprecation_error(self):
169169
with pytest.warns(
170170
FutureWarning,
171171
match=r"HfApi.logout: This method is deprecated in favor of "
172-
r"`unset_access_token` and will be removed in v0.7.",
172+
r"`unset_access_token` and will be removed in v0.8.",
173173
):
174174
try:
175175
self._api.logout()

0 commit comments

Comments
 (0)