diff --git a/docs/source/en/guides/cli.md b/docs/source/en/guides/cli.md index 8bbef37387..e7947a2d30 100644 --- a/docs/source/en/guides/cli.md +++ b/docs/source/en/guides/cli.md @@ -15,7 +15,7 @@ First of all, let's install the CLI: ``` > [!TIP] -> The CLI ships with the core `huggingface_hub` package, so there is no longer a `[cli]` extra to install. +> The CLI ships with the core `huggingface_hub` package. Alternatively, you can install the `hf` CLI with a single command: diff --git a/docs/source/ko/guides/cli.md b/docs/source/ko/guides/cli.md index 835e629cef..df1d7ec038 100644 --- a/docs/source/ko/guides/cli.md +++ b/docs/source/ko/guides/cli.md @@ -15,7 +15,7 @@ rendered properly in your Markdown viewer. ``` > [!TIP] -> CLI는 이제 기본 `huggingface_hub` 패키지에 함께 포함되어 별도의 `[cli]` 추가 종속성이 필요하지 않습니다. +> CLI는 기본 `huggingface_hub` 패키지에 포함되어 있습니다. 설치가 완료되면, CLI가 올바르게 설정되었는지 확인할 수 있습니다: diff --git a/setup.py b/setup.py index 9862deb896..99ba72482c 100644 --- a/setup.py +++ b/setup.py @@ -17,9 +17,10 @@ def get_version() -> str: "filelock", "fsspec>=2023.5.0", "hf-xet>=1.1.3,<2.0.0; platform_machine=='x86_64' or platform_machine=='amd64' or platform_machine=='arm64' or platform_machine=='aarch64'", + "httpx>=0.23.0, <1", "packaging>=20.9", "pyyaml>=5.1", - "httpx>=0.23.0, <1", + "shellingham", "tqdm>=4.42.1", "typer-slim", "typing-extensions>=3.7.4.3", # to be able to import TypeAlias @@ -27,11 +28,6 @@ def get_version() -> str: extras = {} -extras["cli"] = [ - "InquirerPy==0.3.4", # Note: installs `prompt-toolkit` in the background - "shellingham", -] - extras["inference"] = [ "aiohttp", # for AsyncInferenceClient ] @@ -64,8 +60,7 @@ def get_version() -> str: ] + extras["inference"] extras["testing"] = ( - extras["cli"] - + extras["inference"] + extras["inference"] + extras["oauth"] + [ "jedi", diff --git a/src/huggingface_hub/cli/auth.py b/src/huggingface_hub/cli/auth.py index cb522c918c..1c04765031 100644 --- a/src/huggingface_hub/cli/auth.py +++ b/src/huggingface_hub/cli/auth.py @@ -45,14 +45,6 @@ logger = logging.get_logger(__name__) -try: - from InquirerPy import inquirer - from InquirerPy.base.control import Choice - - _inquirer_py_available = True -except ImportError: - _inquirer_py_available = False - auth_cli = typer_factory(help="Manage authentication (login, logout, etc.).") @@ -89,18 +81,6 @@ def _select_token_name() -> Optional[str]: logger.error("No stored tokens found. Please login first.") return None - if _inquirer_py_available: - choices = [Choice(token_name, name=token_name) for token_name in token_names] - try: - return inquirer.select( - message="Select a token to switch to:", - choices=choices, - default=None, - ).execute() - except KeyboardInterrupt: - logger.info("Token selection cancelled.") - return None - # if inquirer is not available, use a simpler terminal UI print("Available stored tokens:") for i, token_name in enumerate(token_names, 1): print(f"{i}. {token_name}") diff --git a/utils/installers/install.ps1 b/utils/installers/install.ps1 index cb7f507cb8..71b89bb62a 100644 --- a/utils/installers/install.ps1 +++ b/utils/installers/install.ps1 @@ -7,7 +7,7 @@ Installs the Hugging Face CLI on Windows by creating an isolated virtual environment and exposing the `hf` command. .DESCRIPTION -Downloads and installs the `huggingface_hub[cli]` package into a dedicated virtual environment, then copies the generated `hf.exe` console script to a directory on the user's PATH. +Downloads and installs the `huggingface_hub` package into a dedicated virtual environment, then copies the generated `hf.exe` console script to a directory on the user's PATH. .PARAMETER Force Recreates the virtual environment even if it already exists. Off by default. @@ -235,13 +235,13 @@ function New-VirtualEnvironment { } function Install-HuggingFaceHub { - $packageSpec = 'huggingface_hub[cli]' + $packageSpec = 'huggingface_hub' $requestedVersion = $env:HF_CLI_VERSION if ($requestedVersion) { - $packageSpec = "huggingface_hub[cli]==$requestedVersion" - Write-Log "Installing huggingface_hub[cli] (version $requestedVersion)..." + $packageSpec = "huggingface_hub==$requestedVersion" + Write-Log "Installing The Hugging Face CLI (version $requestedVersion)..." } else { - Write-Log "Installing huggingface_hub[cli] (latest)..." + Write-Log "Installing The Hugging Face CLI (latest)..." } if (-not $script:VenvPython) { $script:VenvPython = Join-Path $SCRIPTS_DIR "python.exe" } @@ -267,7 +267,7 @@ function Publish-HfCommand { $hfExeSource = Join-Path $SCRIPTS_DIR "hf.exe" if (-not (Test-Path $hfExeSource)) { - throw "hf.exe not found in virtual environment. Check that huggingface_hub[cli] installed correctly." + throw "hf.exe not found in virtual environment. Check that The Hugging Face CLI installed correctly." } $hfExeTarget = Join-Path $BIN_DIR "hf.exe" diff --git a/utils/installers/install.sh b/utils/installers/install.sh index 011fcfb30c..fb7689373d 100755 --- a/utils/installers/install.sh +++ b/utils/installers/install.sh @@ -278,12 +278,12 @@ create_venv() { # Install huggingface_hub with CLI extras install_hf_hub() { - local package_spec="huggingface_hub[cli]" + local package_spec="huggingface_hub" if [ -n "$REQUESTED_VERSION" ]; then - package_spec="huggingface_hub[cli]==$REQUESTED_VERSION" - log_info "Installing huggingface_hub[cli] (version $REQUESTED_VERSION)..." + package_spec="huggingface_hub==$REQUESTED_VERSION" + log_info "Installing The Hugging Face CLI (version $REQUESTED_VERSION)..." else - log_info "Installing huggingface_hub[cli] (latest)..." + log_info "Installing The Hugging Face CLI (latest)..." fi local extra_pip_args="${HF_CLI_PIP_ARGS:-${HF_PIP_ARGS:-}}" @@ -318,7 +318,7 @@ expose_cli_command() { local source_cli="$VENV_DIR/bin/hf" if [ ! -x "$source_cli" ]; then log_error "hf command not found in the virtual environment at $source_cli" - log_error "Verify that huggingface_hub[cli] installed correctly." + log_error "Verify that The Hugging Face CLI is installed correctly." exit 1 fi