Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: typevar with default cause error in typing-extensions<4.11.0 #170

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

gouzil
Copy link
Contributor

@gouzil gouzil commented Dec 8, 2024

In versions prior to typing-extensions 4.11.0, the following error occurs

Traceback (most recent call last):
  File "/Users/user/Documents/git/paddle-tools/autoTable/test.py", line 1, in <module>
    from githubkit import GitHub
  File "/Users/user/miniconda3/envs/py312/lib/python3.12/site-packages/githubkit/__init__.py", line 17, in <module>
    from .core import GitHubCore as GitHubCore
  File "/Users/user/miniconda3/envs/py312/lib/python3.12/site-packages/githubkit/core.py", line 44, in <module>
    class GitHubCore(Generic[A]):
  File "/Users/user/miniconda3/envs/py312/lib/python3.12/site-packages/githubkit/core.py", line 342, in GitHubCore
    ) -> Response[T]: ...
         ~~~~~~~~^^^
  File "/Users/user/miniconda3/envs/py312/lib/python3.12/typing.py", line 384, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/user/miniconda3/envs/py312/lib/python3.12/typing.py", line 1066, in _generic_class_getitem
    _check_generic(cls, params, len(cls.__parameters__))
  File "/Users/user/miniconda3/envs/py312/lib/python3.12/typing.py", line 304, in _check_generic
    raise TypeError(f"Too {'many' if alen > elen else 'few'} arguments for {cls};"
TypeError: Too few arguments for <class 'githubkit.response.Response'>; actual 1, expected 2

Duplicate code

from githubkit import GitHub

@yanyongyu yanyongyu added the bug Something isn't working label Dec 8, 2024
@yanyongyu yanyongyu changed the title 🐛 Fix: Type check error in typing-extensions<4.11.0 Fix: Type check error in typing-extensions<4.11.0 Dec 8, 2024
@yanyongyu yanyongyu changed the title Fix: Type check error in typing-extensions<4.11.0 Fix: typevar with default cause error in typing-extensions<4.11.0 Dec 8, 2024
@yanyongyu
Copy link
Owner

This error is fixed in the python/typing_extensions#293 . so we should increase the minimum required typing-extensions version.

@yanyongyu yanyongyu merged commit 8f7f723 into yanyongyu:master Dec 8, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants