Repository navigation
Allow huggingface-hub 2.x (widen cap from <2 to <3) #1110
Description
Priority Level
Medium (Nice to have)
Is your feature request related to a problem? Please describe.
data-designer and data-designer-engine pin huggingface-hub>=1.0.1,<2. huggingface_hub 2.x has been out since September (current release: 2.3.0), and transformers, datasets and diffusers already allow <3. With the current cap, Data Designer can't be installed alongside packages that need hub 2.x, and its users stay on 1.x.
Describe the solution you'd like
Widen the cap to huggingface-hub>=1.0.1,<3 in both packages/data-designer/pyproject.toml and packages/data-designer-engine/pyproject.toml.
I ran the package test suites (as in ci.yml) at 4bb221e on a clean Linux box, once on the current lock and once with the lock upgraded to hub 2.3.0:
| Package | hub 1.6.0 (current lock) | hub 2.3.0 |
|---|---|---|
| data-designer-config | 830 passed | 830 passed |
| data-designer-engine | 2862 passed | 2862 passed |
| data-designer | 8 failed, 1236 passed | 9 failed, 1235 passed |
The 8 failures on both versions come from my environment: no jq, and the tests running as root. The one extra failure is test-only, and it comes from click, not from hub:
- huggingface_hub 2.3.0 requires
click>=8.4.2(1.x depended ontyperinstead). So upgrading the lock also moves click from 8.3.3 to 8.4.2 - click 8.4.2 adds a "Did you mean '--num-records'?" hint to unknown-option errors, and the error box wraps the text. So
tests/cli/test_main.py::test_app_rejects_unknown_options_before_script_separator, which checks for the exact string"No such option: --num-recrods", no longer matches - Checking for
No such optionand--num-recrodsseparately (or normalising whitespace) would make the test pass on both click versions
Data Designer's own hub usage (HfApi, HfFileSystem, DatasetCard, HfHubHTTPError) passed unchanged on 2.3.0.
Describe alternatives you've considered
Widening the cap without upgrading the lock (only the specifier lines change in uv.lock). That keeps CI on hub 1.6.0 while letting users install 2.x. It's the smallest change, but the lock would no longer cover 2.x in CI.
Agent Investigation
I used Claude Code to find where the cap came from, check the code for APIs that huggingface_hub 2.0 removed, and run the test suites above. The cap dates from the package restructure in #240 (January 2026), before hub 2.0 existed. Data Designer uses none of the APIs removed in 2.0 (upload_large_folder, duplicate_space, stop_sequences, etc.) and doesn't catch httpx transport errors directly.
Additional context
huggingface_hub 2.0's breaking changes are the HTTP stack moving from httpx to httpx2 and the removal of APIs deprecated in 1.x: https://github.com/huggingface/huggingface_hub/blob/main/docs/source/en/concepts/migration_v2.md
I work at Hugging Face and am happy to open the PR (cap change, plus the test fix if you want it) once this is triaged.
Checklist
- I've reviewed existing issues and the documentation
- This is a design proposal, not a "please build this" request
Activity
andreatnvidia commentedon Oct 29, 2026
Thanks for digging into this! Please go ahead with the PR, including both cap changes, the lockfile upgrade to hub 2.x, and the CLI test fix. Normalizing whitespace in that assertion sounds good.
A quick Hugging Face read/upload smoke test would also be useful given the HTTP stack change. I can review once it’s up.