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) -> 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:2405722c-67b8-3df8-16ef-4e3a177394e9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C718:117C62:E9C0AA:138FE4D:6B010B0F |
| html-safe-nonce | d0a5bfc7f209f4e9681c0afcbb3ba0e9588804dc818b3ec58d0fbadb03c69d5e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzE4OjExN0M2MjpFOUMwQUE6MTM4RkU0RDo2QjAxMEIwRiIsInZpc2l0b3JfaWQiOiI4NjY0ODY0MDA0ODMwNzI2OTI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 858dceb8de7670e6b4c5aad11ab451caa6faa316c03906763dc2c3cd31a08b47 |
| 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 | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width