|
11 | 11 | import shutil |
12 | 12 | import platform |
13 | 13 | import os |
| 14 | +import shlex |
14 | 15 | from pathlib import Path |
15 | 16 |
|
16 | | -from .constants import SOURCE_DIR, INSTALL_DIR, BINARY_DIR, WHEELHOUSE_DIR |
17 | | -from .utils import logger, pack, fail |
| 17 | +from .constants import SOURCE_DIR, INSTALL_DIR, BINARY_DIR, WHEELHOUSE_DIR, WHEEL_HOOK |
| 18 | +from .utils import logger, pack, fail, Colors |
18 | 19 | from .build import build_and_install |
19 | 20 | from .windows import win_recompose |
20 | 21 |
|
@@ -69,10 +70,12 @@ def _get_lib_paths(): |
69 | 70 | def make_wheel(args): |
70 | 71 | """Build a wheel.""" |
71 | 72 | logger.warning( |
| 73 | + f"{Colors.WARNING}" |
72 | 74 | "This command builds a TEST wheel, " |
73 | 75 | "not fully compliant to standard " |
74 | 76 | "and only intended for test. " |
75 | 77 | "DO NOT USE IN PRODUCTION." |
| 78 | + f"{Colors.ENDC}" |
76 | 79 | ) |
77 | 80 | # Build and install pyluxcore |
78 | 81 | args.target = "pyluxcore" |
@@ -171,3 +174,14 @@ def make_wheel(args): |
171 | 174 | if platform.system() == "Windows": |
172 | 175 | args.wheel = WHEELHOUSE_DIR / wheelname |
173 | 176 | win_recompose(args) |
| 177 | + |
| 178 | + # Finally, execute hook if exists |
| 179 | + if WHEEL_HOOK: |
| 180 | + logger.info("Executing hook: " + WHEEL_HOOK) |
| 181 | + try: |
| 182 | + result = subprocess.check_output( |
| 183 | + shlex.split(WHEEL_HOOK), text=True |
| 184 | + ) |
| 185 | + except subprocess.CalledProcessError as err: |
| 186 | + fail(err) |
| 187 | + logger.info(result) |
0 commit comments