From 4fd53da764f9204506eecf71257ef62662b4b078 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:16:31 +0800 Subject: [PATCH] :bug: Fix: missing ghes lazy loading (#108) --- .pre-commit-config.yaml | 6 ------ githubkit/lazy_module.py | 11 ++++++----- tests/test_versions/test_models.py | 9 +++++++++ tests/test_versions/test_types.py | 9 +++++++++ 4 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 tests/test_versions/test_models.py create mode 100644 tests/test_versions/test_types.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a407a3dd3..ffe961422 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,12 +21,6 @@ repos: - id: ruff-format stages: [commit] - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 - hooks: - - id: prettier - stages: [commit] - - repo: https://github.com/nonebot/nonemoji rev: v0.1.4 hooks: diff --git a/githubkit/lazy_module.py b/githubkit/lazy_module.py index 838f6530a..7a93dc138 100644 --- a/githubkit/lazy_module.py +++ b/githubkit/lazy_module.py @@ -9,11 +9,12 @@ LAZY_MODULES = ( r"^githubkit\.rest$", - r"^githubkit\.versions\.v[^.]+\.models$", - r"^githubkit\.versions\.v[^.]+\.webhooks$", - r"^githubkit\.versions\.latest\.models$", - r"^githubkit\.versions\.latest\.types$", - r"^githubkit\.versions\.latest\.webhooks$", + r"^githubkit\.versions\.[^.]+\.models$", + r"^githubkit\.versions\.[^.]+\.types$", + r"^githubkit\.versions\.[^.]+\.webhooks$", + # r"^githubkit\.versions\.latest\.models$", + # r"^githubkit\.versions\.latest\.types$", + # r"^githubkit\.versions\.latest\.webhooks$", ) diff --git a/tests/test_versions/test_models.py b/tests/test_versions/test_models.py new file mode 100644 index 000000000..eb2d1aa7d --- /dev/null +++ b/tests/test_versions/test_models.py @@ -0,0 +1,9 @@ +from githubkit.versions.latest.models import ( # noqa: F401 + SimpleUser as SimpleUserLatest, +) +from githubkit.versions.v2022_11_28.models import ( # noqa: F401 + SimpleUser as SimpleUserV2022_11_28, +) +from githubkit.versions.ghec_v2022_11_28.models import ( # noqa: F401 + SimpleUser as SimpleUserGhecV2022_11_28, +) diff --git a/tests/test_versions/test_types.py b/tests/test_versions/test_types.py new file mode 100644 index 000000000..ecdeb49ef --- /dev/null +++ b/tests/test_versions/test_types.py @@ -0,0 +1,9 @@ +from githubkit.versions.latest.types import ( # noqa: F401 + SimpleUserType as SimpleUserLatestType, +) +from githubkit.versions.v2022_11_28.types import ( # noqa: F401 + SimpleUserType as SimpleUserV2022_11_28Type, +) +from githubkit.versions.ghec_v2022_11_28.types import ( # noqa: F401 + SimpleUserType as SimpleUserGhecV2022_11_28Type, +)