Title: Mypy linting issue with Repo.clone_from and progress bar · Issue #2001 · gitpython-developers/GitPython · GitHub
Open Graph Title: Mypy linting issue with Repo.clone_from and progress bar · Issue #2001 · gitpython-developers/GitPython
X Title: Mypy linting issue with Repo.clone_from and progress bar · Issue #2001 · gitpython-developers/GitPython
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):...
Open Graph 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.RemoteProgre...
X 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.RemoteProgre...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/2001
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mypy linting issue with Repo.clone_from and progress bar","articleBody":"Hi,\n\nConsider the following example:\n\n```python\nimport rich.progress\nimport git\nfrom git import Repo\nfrom rich.console import Console\n\nconsole = Console(log_path=False)\n\nclass GitProgressPrinter(git.RemoteProgress):\n def __init__(self, progress, name):\n super().__init__()\n self.progress = progress\n self.name = name\n self.task = progress.add_task(name)\n\n def update(self, op_code, cur_count, max_count=None, message=\"\"):\n pass\n\n\ndef main():\n with rich.progress.Progress(console=console) as progress:\n progress_bar = GitProgressPrinter(progress, \"My Repo\")\n Repo.clone_from(\"url\", \"dir\", progress=progress_bar, depth=1)\n```\n\nUsing `gitpython==3.1.44` and `mypy==1.15.0`, it shows the following message:\n\n\n\n```\nArgument of type \"GitProgressPrinter\" cannot be assigned to parameter \"progress\" of type \"CallableProgress\" in function \"clone_from\"\n Type \"GitProgressPrinter\" is not assignable to type \"CallableProgress\"\n Type \"GitProgressPrinter\" is not assignable to type \"(int, str | float, str | float | None, str) -\u003e None\"\n \"GitProgressPrinter\" is not assignable to \"None\"\n```\n\nCan you help me understand what's wrong here? Missing typing info on the gitpython side?","author":{"url":"https://github.com/jdumas","@type":"Person","name":"jdumas"},"datePublished":"2025-02-07T20:15:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2001/GitPython/issues/2001"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4ccc43cb-00c5-036b-f53a-60937b8cf1d5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A934:E27E8:77373E:A10BF0:6969DAC3 |
| html-safe-nonce | 995c81f65e5413408a105cc707ad73e3602dc5dd0f3d1883f56620b1005f620c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTM0OkUyN0U4Ojc3MzczRTpBMTBCRjA6Njk2OURBQzMiLCJ2aXNpdG9yX2lkIjoiNTc3MjUxODUxOTU1NDU2Mjc1NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 67e68ad28de4487b0cb8c5a079bf1ebc18b436ff7361117394c2a8fad8c97659 |
| hovercard-subject-tag | issue:2839012285 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/2001/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c43ebae06c0604f8c5873b26f62c8adaee4a078675010e96789622fff9f8e04f/gitpython-developers/GitPython/issues/2001 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c43ebae06c0604f8c5873b26f62c8adaee4a078675010e96789622fff9f8e04f/gitpython-developers/GitPython/issues/2001 |
| og:image:alt | 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.RemoteProgre... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jdumas |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width