Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,19 @@ exclude = [
"venv",
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
lines-after-imports = 2
known-first-party = ["huggingface_hub"]

[tool.pytest.ini_options]
# Add the specified `OPTS` to the set of command line arguments as if they had
# been specified by the user.
addopts = "-Werror::FutureWarning --log-cli-level=INFO -sv --durations=0"
# The defined variables will be added to the environment before any tests are
# run, part of pytest-env plugin
env = [
"HF_TOKEN=",
"HUGGING_FACE_HUB_TOKEN=",
"HUGGINGFACE_CO_STAGING=1",
"DISABLE_SYMLINKS_IN_WINDOWS_TESTS=1",
]
74 changes: 0 additions & 74 deletions setup.cfg

This file was deleted.

23 changes: 12 additions & 11 deletions src/huggingface_hub/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flake8: noqa
#!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
Expand All @@ -15,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License

# ruff: noqa: F401

from . import tqdm as _tqdm # _tqdm is the module
from ._cache_assets import cached_assets_path
from ._cache_manager import (
Expand All @@ -31,25 +32,24 @@
from ._datetime import parse_datetime
from ._errors import (
BadRequestError,
DisabledRepoError,
EntryNotFoundError,
FileMetadataError,
GatedRepoError,
HfHubHTTPError,
LocalEntryNotFoundError,
DisabledRepoError,
RepositoryNotFoundError,
RevisionNotFoundError,
hf_raise_for_status,
)
from ._token import get_token
from ._experimental import experimental
from ._fixes import SoftTemporaryDirectory, yaml_dump
from ._git_credential import list_credential_helpers, set_git_credential, unset_git_credential
from ._headers import build_hf_headers, get_token_to_send, LocalTokenNotFoundError
from ._headers import LocalTokenNotFoundError, build_hf_headers, get_token_to_send
from ._hf_folder import HfFolder
from ._http import configure_http_backend, get_session, http_backoff, reset_sessions, OfflineModeIsEnabled
from ._http import OfflineModeIsEnabled, configure_http_backend, get_session, http_backoff, reset_sessions
from ._pagination import paginate
from ._paths import filter_repo_objects, IGNORE_GIT_FOLDER_PATTERNS
from ._experimental import experimental
from ._paths import IGNORE_GIT_FOLDER_PATTERNS, filter_repo_objects
from ._runtime import (
dump_environment_info,
get_aiohttp_version,
Expand All @@ -71,13 +71,13 @@
is_aiohttp_available,
is_fastai_available,
is_fastcore_available,
is_numpy_available,
is_google_colab,
is_gradio_available,
is_graphviz_available,
is_hf_transfer_available,
is_jinja_available,
is_notebook,
is_numpy_available,
is_pillow_available,
is_pydantic_available,
is_pydot_available,
Expand All @@ -86,13 +86,15 @@
is_torch_available,
)
from ._safetensors import (
NotASafetensorsRepoError,
SafetensorsFileMetadata,
SafetensorsParsingError,
SafetensorsRepoMetadata,
TensorInfo,
SafetensorsParsingError,
NotASafetensorsRepoError,
)
from ._subprocess import capture_output, run_interactive_subprocess, run_subprocess
from ._telemetry import send_telemetry
from ._token import get_token
from ._validators import (
HFValidationError,
smoothly_deprecate_use_auth_token,
Expand All @@ -106,4 +108,3 @@
tqdm,
tqdm_stream_file,
)
from ._telemetry import send_telemetry