|
10 | 10 | See build.py for the build command itself. |
11 | 11 | ''' |
12 | 12 |
|
13 | | -import zcmake |
14 | 13 | import os |
15 | 14 | import sys |
16 | 15 | from pathlib import Path |
| 16 | + |
| 17 | +import zcmake |
17 | 18 | from west import log |
18 | 19 | from west.configuration import config |
19 | 20 | from west.util import escapes_directory |
|
22 | 23 | # twister also uses the implementation |
23 | 24 | script_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) |
24 | 25 | sys.path.insert(0, os.path.join(script_dir, "pylib/build_helpers/")) |
25 | | -from domains import Domains |
| 26 | +from domains import Domains # noqa: E402 |
26 | 27 |
|
27 | 28 | DEFAULT_BUILD_DIR = 'build' |
28 | 29 | '''Name of the default Zephyr build directory.''' |
29 | 30 |
|
30 | 31 | DEFAULT_CMAKE_GENERATOR = 'Ninja' |
31 | 32 | '''Name of the default CMake generator.''' |
32 | 33 |
|
33 | | -FIND_BUILD_DIR_DESCRIPTION = '''\ |
34 | | -If the build directory is not given, the default is {}/ unless the |
| 34 | +FIND_BUILD_DIR_DESCRIPTION = f'''\ |
| 35 | +If the build directory is not given, the default is {DEFAULT_BUILD_DIR}/ unless the |
35 | 36 | build.dir-fmt configuration variable is set. The current directory is |
36 | 37 | checked after that. If either is a Zephyr build directory, it is used. |
37 | | -'''.format(DEFAULT_BUILD_DIR) |
| 38 | +''' |
38 | 39 |
|
39 | 40 | def _resolve_build_dir(fmt, guess, cwd, **kwargs): |
40 | 41 | # Remove any None values, we do not want 'None' as a string |
@@ -100,14 +101,14 @@ def find_build_dir(dir, guess=False, **kwargs): |
100 | 101 | cwd = os.getcwd() |
101 | 102 | default = config.get('build', 'dir-fmt', fallback=DEFAULT_BUILD_DIR) |
102 | 103 | default = _resolve_build_dir(default, guess, cwd, **kwargs) |
103 | | - log.dbg('config dir-fmt: {}'.format(default), level=log.VERBOSE_EXTREME) |
| 104 | + log.dbg(f'config dir-fmt: {default}', level=log.VERBOSE_EXTREME) |
104 | 105 | if default and is_zephyr_build(default): |
105 | 106 | build_dir = default |
106 | 107 | elif is_zephyr_build(cwd): |
107 | 108 | build_dir = cwd |
108 | 109 | else: |
109 | 110 | build_dir = default |
110 | | - log.dbg('build dir: {}'.format(build_dir), level=log.VERBOSE_EXTREME) |
| 111 | + log.dbg(f'build dir: {build_dir}', level=log.VERBOSE_EXTREME) |
111 | 112 | if build_dir: |
112 | 113 | return os.path.abspath(build_dir) |
113 | 114 | else: |
|
0 commit comments