|
1 | | -# SPDX-License-Identifier: Apache-2.0 |
2 | | -# Copyright 2026 Ague Samuel Amen |
3 | | -# |
4 | | -# Licensed under the Apache License, Version 2.0 (the "License"); |
5 | | -# you may not use this file except in compliance with the License. |
6 | | -# You may obtain a copy of the License at |
7 | | -# |
8 | | -# http://www.apache.org/licenses/LICENSE-2.0 |
9 | | -# |
10 | | -# Unless required by applicable law or agreed to in writing, software |
11 | | -# distributed under the License is distributed on an "AS IS" BASIS, |
12 | | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | | -# See the License for the specific language governing permissions and |
14 | | -# limitations under the License. |
| 1 | +from .engine import PyInstallerEngine |
15 | 2 |
|
16 | | -from __future__ import annotations |
17 | | - |
18 | | -import importlib |
19 | | -import pkgutil |
20 | | - |
21 | | -__all__: list[str] = [] |
22 | | - |
23 | | -# Explicit registration to ensure the engine is available even if auto-import misses it |
24 | | -try: |
25 | | - from engine_sdk import registry as _registry # type: ignore |
26 | | - |
27 | | - from .engine import PyInstallerEngine as _PyInstallerEngine |
28 | | - |
29 | | - if _registry: |
30 | | - _registry.register(_PyInstallerEngine) |
31 | | -except Exception: |
32 | | - pass |
33 | | - |
34 | | - |
35 | | -def _auto_import_all() -> None: |
36 | | - """ |
37 | | - Import all Python modules and subpackages contained in this package. |
38 | | - This ensures any engine definitions or side-effects are loaded on import. |
39 | | - """ |
40 | | - try: |
41 | | - pkg_name = __name__ |
42 | | - for _finder, name, _ispkg in pkgutil.walk_packages( |
43 | | - __path__, prefix=f"{pkg_name}." |
44 | | - ): |
45 | | - try: |
46 | | - importlib.import_module(name) |
47 | | - short = name.rsplit(".", 1)[-1] |
48 | | - if short not in __all__: |
49 | | - __all__.append(short) |
50 | | - except Exception: |
51 | | - pass |
52 | | - except Exception: |
53 | | - pass |
54 | | - |
55 | | - |
56 | | -_auto_import_all() |
| 3 | +__all__ = ["PyInstallerEngine"] |
0 commit comments