yanyongyu / githubkit

The modern, all-batteries-included GitHub SDK for Python, including rest api, graphql, webhooks, like octokit!
MIT License
159 stars 21 forks source link

Bug: duplicate argument 'name' in path and body #16

Closed ASRagab closed 1 year ago

ASRagab commented 1 year ago

Minimal reproduction:

from githubkit import GitHub, TokenAuthStrategy
gh = GitHub(TokenAuthStrategy("")).rest

Error:

Traceback (most recent call last):

  File "/usr/local/lib/python3.8/dist-packages/IPython/core/interactiveshell.py", line 3326, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File ["<ipython-input-3-4ec18c08ad11>"](https://localhost:8080/#), line 1, in <module>
    from githubkit import GitHub, TokenAuthStrategy

  File "/usr/local/lib/python3.8/dist-packages/githubkit/__init__.py", line 2, in <module>
    from .github import GitHub as GitHub

  File "/usr/local/lib/python3.8/dist-packages/githubkit/github.py", line 16, in <module>
    from .core import GitHubCore

  File "/usr/local/lib/python3.8/dist-packages/githubkit/core.py", line 24, in <module>
    from .auth import BaseAuthStrategy, TokenAuthStrategy, UnauthAuthStrategy

  File "/usr/local/lib/python3.8/dist-packages/githubkit/auth/__init__.py", line 1, in <module>
    from .app import AppAuthStrategy as AppAuthStrategy

  File "/usr/local/lib/python3.8/dist-packages/githubkit/auth/app.py", line 10, in <module>
    from githubkit.rest import (

  File "/usr/local/lib/python3.8/dist-packages/githubkit/rest/__init__.py", line 25, in <module>
    from .actions import ActionsClient

  File "/usr/local/lib/python3.8/dist-packages/githubkit/rest/actions.py", line 2189
    def update_org_variable(
    ^
SyntaxError: duplicate argument 'name' in function definition

Not a python expert, but the error seems to be here: https://github.com/yanyongyu/githubkit/blob/2285d0176a0d01556ced839b275b5ec90a68ab5b/githubkit/rest/actions.py#L2195

https://github.com/yanyongyu/githubkit/blob/2285d0176a0d01556ced839b275b5ec90a68ab5b/githubkit/rest/actions.py#L2238

Same possible issue in the async version of the signature. Issue is not present in 0.9.4

yanyongyu commented 1 year ago

It seems both body and path has a field names name. We should make some patches to avoid field name conflict.

yanyongyu commented 1 year ago

I just published a new version and yanked version 0.9.5. Thx for your feedback! 😄

ASRagab commented 1 year ago

Thank you!!