Skip to content

Commit 36d0949

Browse files
[CLI] Remove [cli] extra (#3451)
* remove cli extra * fix * too fast * reorder deps by alphabetical order
1 parent 6d3a630 commit 36d0949

File tree

6 files changed

+16
-41
lines changed

6 files changed

+16
-41
lines changed

docs/source/en/guides/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ First of all, let's install the CLI:
1515
```
1616

1717
> [!TIP]
18-
> The CLI ships with the core `huggingface_hub` package, so there is no longer a `[cli]` extra to install.
18+
> The CLI ships with the core `huggingface_hub` package.
1919
2020
Alternatively, you can install the `hf` CLI with a single command:
2121

docs/source/ko/guides/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ rendered properly in your Markdown viewer.
1515
```
1616

1717
> [!TIP]
18-
> CLI는 이제 기본 `huggingface_hub` 패키지에 함께 포함되어 별도의 `[cli]` 추가 종속성이 필요하지 않습니다.
18+
> CLI는 기본 `huggingface_hub` 패키지에 포함되어 있습니다.
1919
2020
설치가 완료되면, CLI가 올바르게 설정되었는지 확인할 수 있습니다:
2121

setup.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,17 @@ def get_version() -> str:
1717
"filelock",
1818
"fsspec>=2023.5.0",
1919
"hf-xet>=1.1.3,<2.0.0; platform_machine=='x86_64' or platform_machine=='amd64' or platform_machine=='arm64' or platform_machine=='aarch64'",
20+
"httpx>=0.23.0, <1",
2021
"packaging>=20.9",
2122
"pyyaml>=5.1",
22-
"httpx>=0.23.0, <1",
23+
"shellingham",
2324
"tqdm>=4.42.1",
2425
"typer-slim",
2526
"typing-extensions>=3.7.4.3", # to be able to import TypeAlias
2627
]
2728

2829
extras = {}
2930

30-
extras["cli"] = [
31-
"InquirerPy==0.3.4", # Note: installs `prompt-toolkit` in the background
32-
"shellingham",
33-
]
34-
3531
extras["inference"] = [
3632
"aiohttp", # for AsyncInferenceClient
3733
]
@@ -64,8 +60,7 @@ def get_version() -> str:
6460
] + extras["inference"]
6561

6662
extras["testing"] = (
67-
extras["cli"]
68-
+ extras["inference"]
63+
extras["inference"]
6964
+ extras["oauth"]
7065
+ [
7166
"jedi",

src/huggingface_hub/cli/auth.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@
4545

4646
logger = logging.get_logger(__name__)
4747

48-
try:
49-
from InquirerPy import inquirer
50-
from InquirerPy.base.control import Choice
51-
52-
_inquirer_py_available = True
53-
except ImportError:
54-
_inquirer_py_available = False
55-
5648

5749
auth_cli = typer_factory(help="Manage authentication (login, logout, etc.).")
5850

@@ -89,18 +81,6 @@ def _select_token_name() -> Optional[str]:
8981
logger.error("No stored tokens found. Please login first.")
9082
return None
9183

92-
if _inquirer_py_available:
93-
choices = [Choice(token_name, name=token_name) for token_name in token_names]
94-
try:
95-
return inquirer.select(
96-
message="Select a token to switch to:",
97-
choices=choices,
98-
default=None,
99-
).execute()
100-
except KeyboardInterrupt:
101-
logger.info("Token selection cancelled.")
102-
return None
103-
# if inquirer is not available, use a simpler terminal UI
10484
print("Available stored tokens:")
10585
for i, token_name in enumerate(token_names, 1):
10686
print(f"{i}. {token_name}")

utils/installers/install.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Installs the Hugging Face CLI on Windows by creating an isolated virtual environment and exposing the `hf` command.
88
99
.DESCRIPTION
10-
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.
10+
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.
1111
1212
.PARAMETER Force
1313
Recreates the virtual environment even if it already exists. Off by default.
@@ -235,13 +235,13 @@ function New-VirtualEnvironment {
235235
}
236236

237237
function Install-HuggingFaceHub {
238-
$packageSpec = 'huggingface_hub[cli]'
238+
$packageSpec = 'huggingface_hub'
239239
$requestedVersion = $env:HF_CLI_VERSION
240240
if ($requestedVersion) {
241-
$packageSpec = "huggingface_hub[cli]==$requestedVersion"
242-
Write-Log "Installing huggingface_hub[cli] (version $requestedVersion)..."
241+
$packageSpec = "huggingface_hub==$requestedVersion"
242+
Write-Log "Installing The Hugging Face CLI (version $requestedVersion)..."
243243
} else {
244-
Write-Log "Installing huggingface_hub[cli] (latest)..."
244+
Write-Log "Installing The Hugging Face CLI (latest)..."
245245
}
246246
if (-not $script:VenvPython) { $script:VenvPython = Join-Path $SCRIPTS_DIR "python.exe" }
247247

@@ -267,7 +267,7 @@ function Publish-HfCommand {
267267

268268
$hfExeSource = Join-Path $SCRIPTS_DIR "hf.exe"
269269
if (-not (Test-Path $hfExeSource)) {
270-
throw "hf.exe not found in virtual environment. Check that huggingface_hub[cli] installed correctly."
270+
throw "hf.exe not found in virtual environment. Check that The Hugging Face CLI installed correctly."
271271
}
272272

273273
$hfExeTarget = Join-Path $BIN_DIR "hf.exe"

utils/installers/install.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,12 @@ create_venv() {
278278

279279
# Install huggingface_hub with CLI extras
280280
install_hf_hub() {
281-
local package_spec="huggingface_hub[cli]"
281+
local package_spec="huggingface_hub"
282282
if [ -n "$REQUESTED_VERSION" ]; then
283-
package_spec="huggingface_hub[cli]==$REQUESTED_VERSION"
284-
log_info "Installing huggingface_hub[cli] (version $REQUESTED_VERSION)..."
283+
package_spec="huggingface_hub==$REQUESTED_VERSION"
284+
log_info "Installing The Hugging Face CLI (version $REQUESTED_VERSION)..."
285285
else
286-
log_info "Installing huggingface_hub[cli] (latest)..."
286+
log_info "Installing The Hugging Face CLI (latest)..."
287287
fi
288288

289289
local extra_pip_args="${HF_CLI_PIP_ARGS:-${HF_PIP_ARGS:-}}"
@@ -318,7 +318,7 @@ expose_cli_command() {
318318
local source_cli="$VENV_DIR/bin/hf"
319319
if [ ! -x "$source_cli" ]; then
320320
log_error "hf command not found in the virtual environment at $source_cli"
321-
log_error "Verify that huggingface_hub[cli] installed correctly."
321+
log_error "Verify that The Hugging Face CLI is installed correctly."
322322
exit 1
323323
fi
324324

0 commit comments

Comments
 (0)