Skip to content

[CI] Add import check with base dependencies only#4250

Merged
hanouticelina merged 1 commit into
mainfrom
ci/check-imports-no-extras
May 22, 2026
Merged

[CI] Add import check with base dependencies only#4250
hanouticelina merged 1 commit into
mainfrom
ci/check-imports-no-extras

Conversation

@Wauplin

@Wauplin Wauplin commented May 22, 2026

Copy link
Copy Markdown
Collaborator

(related slack thread)

Summary

  • Adds a check-imports job to the CI that installs huggingface_hub with only base dependencies (no extras) and runs from huggingface_hub import *.
  • This catches cases where a new import is added in the public API surface that requires a library not listed in install_requires, which would result in an ImportError for users installing the package without dev extras.

Motivated by #4248 where a transitive dependency (urllib3) was imported at the top level, causing an ImportError for users after release. The existing CI didn't catch it because test dependencies pull in the missing library.

🤖 Generated with Claude Code


Note

Low Risk
Low risk since it only changes CI configuration; potential impact is limited to longer or occasionally flakier CI runs due to the new environment setup step.

Overview
Adds a new check-imports GitHub Actions job that creates a fresh venv, installs the project with base dependencies only (uv pip install .), and runs from huggingface_hub import * to catch missing install_requires dependencies in the public API surface before release.

Reviewed by Cursor Bugbot for commit dd7c6bc. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Wauplin Wauplin requested a review from hanouticelina May 22, 2026 07:30

@hanouticelina hanouticelina left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@hanouticelina hanouticelina merged commit f4586dd into main May 22, 2026
22 checks passed
@hanouticelina hanouticelina deleted the ci/check-imports-no-extras branch May 22, 2026 09:21
@huggingface-hub-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.17.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants