← 返回首页
Mypy linting issue with Repo.clone_from and progress bar · Issue #2001 · gitpython-developers/GitPython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Mypy linting issue with Repo.clone_from and progress bar #2001

New issue
New issue

Description

Hi,

Consider the following example:

import rich.progress import git from git import Repo from rich.console import Console console = Console(log_path=False) class GitProgressPrinter(git.RemoteProgress): def __init__(self, progress, name): super().__init__() self.progress = progress self.name = name self.task = progress.add_task(name) def update(self, op_code, cur_count, max_count=None, message=""): pass def main(): with rich.progress.Progress(console=console) as progress: progress_bar = GitProgressPrinter(progress, "My Repo") Repo.clone_from("url", "dir", progress=progress_bar, depth=1)

Using gitpython==3.1.44 and mypy==1.15.0, it shows the following message:

Argument of type "GitProgressPrinter" cannot be assigned to parameter "progress" of type "CallableProgress" in function "clone_from"   Type "GitProgressPrinter" is not assignable to type "CallableProgress"     Type "GitProgressPrinter" is not assignable to type "(int, str | float, str | float | None, str) -> None"     "GitProgressPrinter" is not assignable to "None"

Can you help me understand what's wrong here? Missing typing info on the gitpython side?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Footer

      © 2026 GitHub, Inc.