forked from loafle/openapi-generator-original
python: feature flag for lazy imports (#21885)
* python: feature flag for lazy imports * python: update samples * python: add python-lazyImports to test job * python: reuse tests in lazyImports sample * python: avoid using non-imported submodules * add normalizer option --------- Co-authored-by: Pascal Bachor <bachorp@users.noreply.github.com> Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
@@ -1,21 +1,6 @@
|
||||
# flake8: noqa
|
||||
|
||||
if __import__("typing").TYPE_CHECKING:
|
||||
# import apis into api package
|
||||
from openapi_client.api.auth_api import AuthApi
|
||||
from openapi_client.api.body_api import BodyApi
|
||||
from openapi_client.api.form_api import FormApi
|
||||
from openapi_client.api.header_api import HeaderApi
|
||||
from openapi_client.api.path_api import PathApi
|
||||
from openapi_client.api.query_api import QueryApi
|
||||
|
||||
else:
|
||||
from lazy_imports import LazyModule, as_package, load
|
||||
|
||||
load(
|
||||
LazyModule(
|
||||
*as_package(__file__),
|
||||
"""# import apis into api package
|
||||
# import apis into api package
|
||||
from openapi_client.api.auth_api import AuthApi
|
||||
from openapi_client.api.body_api import BodyApi
|
||||
from openapi_client.api.form_api import FormApi
|
||||
@@ -23,8 +8,3 @@ from openapi_client.api.header_api import HeaderApi
|
||||
from openapi_client.api.path_api import PathApi
|
||||
from openapi_client.api.query_api import QueryApi
|
||||
|
||||
""",
|
||||
name=__name__,
|
||||
doc=__doc__,
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user