Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Provide feedback

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

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Unanswered
jdumas asked this question inQ&A
Discussion options

Hi,

Consider the following example:

importrich.progressimportgitfromgitimportRepofromrich.consoleimportConsoleconsole=Console(log_path=False)classGitProgressPrinter(git.RemoteProgress):def__init__(self,progress,name):super().__init__()self.progress=progressself.name=nameself.task=progress.add_task(name)defupdate(self,op_code,cur_count,max_count=None,message=""):passdefmain():withrich.progress.Progress(console=console)asprogress:progress_bar=GitProgressPrinter(progress,"My Repo")Repo.clone_from("url","dir",progress=progress_bar,depth=1)

Usinggitpython==3.1.44 andmypy==1.15.0, it shows the following message:

Image

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?

You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@jdumas
Converted from issue

This discussion was converted from issue #2001 on February 08, 2025 15:12.


[8]ページ先頭

©2009-2025 Movatter.jp