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: user:token@github.com
IPv4 address: 140.82.113.3
{"@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) -> 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:40Z","url":"https://github.com/gitpython-developers/GitPython/issues/2001"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:3c264b14-55f6-a4d4-50f3-d0bf0583f73e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DAC4:1352AF:1022ED1:159C629:6B0657D4 |
| html-safe-nonce | 4921b17153cc531f739f9f91a6c48e91cf4a9de07ca5f86b1ea025c43c06dafb |
| visitor-payload | eyJyZWZlcnJlciI6bnVsbCwicmVxdWVzdF9pZCI6IkRBQzQ6MTM1MkFGOjEwMjJFRDE6MTU5QzYyOTo2QjA2NTdENCIsInZpc2l0b3JfaWQiOiI0MzM0MjM0MjQyNDU3Njg4MDIwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiY2VudHJhbHVzIn0= |
| visitor-hmac | f1dc8012ffa35871ea552898a3a953da37b46b88830ea2c3a85d2a831d25a2b4 |
| 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 | 6324e6ac990fb6befbec840cc0e102a1071c339bfe8f9826bb12de2e3ba1d297 |
| 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 | 7f0aa75f4141d440c6110dc31af7ea7797abb6c4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width