transformers - ✅(Solved) Fix Add typing support incrementally (meta issue) [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
huggingface/transformers#45458Fetched 2026-04-17 08:22:47
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Assignees
Timeline (top)
cross-referenced ×2assigned ×1subscribed ×1

Fix Action

Fixed

PR fix notes

PR #45432: chore(qa): split pipeline and add type checking

Description (problem / solution / changelog)

What does this PR do?

This patch adds the pipeline in our type checker, and also adds mccabe complexity in our Ruff linter with a 75 threshold for now.

To reduce complexity, logical blocks are now splitted into private functions to improve maintainability and readability.

Changed files

  • .circleci/config.yml (modified, +1/-1)
  • pyproject.toml (modified, +5/-0)
  • src/transformers/pipelines/__init__.py (modified, +279/-192)
  • tests/pipelines/test_pipelines_common.py (modified, +11/-0)
  • utils/check_types.py (modified, +2/-0)

PR #45425: chore(typing): added modeling_utils to ty

Description (problem / solution / changelog)

What does this PR do?

Adds type checking to modeling_utils.py

Changed files

  • .ai/skills/add-or-fix-type-checking/SKILL.md (modified, +28/-12)
  • src/transformers/_typing.py (modified, +1/-0)
  • src/transformers/modeling_utils.py (modified, +98/-57)
  • utils/check_types.py (modified, +2/-0)

Code Example

make typing
RAW_BUFFERClick to expand / collapse

We’re progressively adding typing support to the codebase using ty. This issue tracks the overall progress as we extend coverage directory by directory.

Current status

The tooling is already in place. Type checking is enabled for a subset of directories

You can run it locally with:

make typing

How to contribute

To add typing support to a new file or directory:

Helper resources

There is an internal skill to assist with adding or fixing typing when using AI agents

.ai/skills/add-or-fix-type-checking/SKILL.md

This guide is continuously refined as we make progress, so it’s a good starting point.

extent analysis

TL;DR

To add typing support to a new file or directory, register it in utils/check_types.py under CHECKER_CONFIG and run make typing to fix reported issues.

Guidance

  • Review the CHECKER_CONFIG in utils/check_types.py to understand the current typing coverage and plan additions.
  • Use the internal skill guide at .ai/skills/add-or-fix-type-checking/SKILL.md for assistance with adding or fixing type checking.
  • Run make typing locally to test and validate typing support for the updated directories or files.
  • Iterate on fixing reported issues until type checking passes without errors.

Notes

The provided information focuses on the process of adding typing support rather than resolving a specific issue, so the guidance is aimed at contributing to the ongoing effort of extending type checking coverage.

Recommendation

Apply the workaround by following the provided steps to add typing support to new files or directories, as there is no indication of a version upgrade being necessary.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

transformers - ✅(Solved) Fix Add typing support incrementally (meta issue) [2 pull requests, 1 participants]