yanyongyu / githubkit

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

Github Enterprise API causes type import errors #107

Closed FaeyUmbrea closed 3 weeks ago

FaeyUmbrea commented 3 weeks ago

Using the ghec version of the api causes "cannot import name" issues across the entirety of the model data.

FaeyUmbrea commented 3 weeks ago

I've investigated it a bit more and it appears as though the issue is due to the runtime failing to resolve the symbols from the ghec variant, although I can not figure out any reason why it should fail, considering the code is pretty much identical.

The failure also is reproducable simply by importing any of the models from the ghec variant.

yanyongyu commented 3 weeks ago

Could you please provide your reproduce code and the error message?

FaeyUmbrea commented 3 weeks ago

Unfortunately, the code itself is under NDA, but I can provide a snippet that is capable of reproducting the bug.

As little as

from githubkit.versions.ghec_v2022_11_28.models import Runner

will cause

ImportError: cannot import name 'Runner' from 'githubkit.versions.ghec_v2022_11_28.models' ([path to __init__.py])

yanyongyu commented 3 weeks ago

I can reproduce this error. It's due to a stupid error that i forget adding the module to lazy loading list :joy: