Skip to content

Commit 7bc2468

Browse files
authored
Improve debug printing for Meson editable installs (#192)
2 parents 50f3cc6 + 88457cd commit 7bc2468

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

spin/cmds/pip.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@
55

66
@click.command()
77
@click.option(
8-
"-v",
9-
"--verbose",
10-
is_flag=True,
11-
default=False,
12-
help="Print detailed build and installation output",
8+
"--editable/--no-editable",
9+
default=True,
10+
help="Install in editable mode.",
1311
)
12+
@click.option("-v", "--verbose", is_flag=True, help="Print detailed build output.")
1413
@click.option(
15-
"--editable/--no-editable",
14+
"--verbose-import/--no-verbose-import",
1615
is_flag=True,
1716
default=True,
18-
help="Install in editable mode",
17+
help="Meson only: importing an editable install may trigger a build. This flag determines whether to print that build's output.",
1918
)
2019
@click.argument("pip_args", nargs=-1)
21-
def install(pip_args, verbose, editable):
20+
def install(*, pip_args, editable, verbose, verbose_import):
2221
"""💽 Build and install package using pip.
2322
2423
By default, the package is installed in editable mode.
@@ -34,9 +33,14 @@ def install(pip_args, verbose, editable):
3433
pip_args = list(pip_args)
3534
pip_cmd = ["pip", "install"]
3635
pip_args += ["--no-build-isolation"]
36+
3737
if editable:
3838
pip_args += ["--editable"]
3939

40-
pip_args = (["-v"] if verbose else []) + pip_args
40+
if verbose_import:
41+
pip_args = ["--config-settings=editable-verbose=true"] + pip_args
42+
43+
if verbose:
44+
pip_args = ["-v"] + pip_args
4145

4246
_run(pip_cmd + pip_args + ["."], sys_exit=False, replace=True)

0 commit comments

Comments
 (0)