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,14 +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" ]
39- if verbose :
40- # In case meson is used to install the editable hook, tell it to
41- # print verbose output each time an import triggers a build.
42- # This does not seem to affect setuptools builds.
39+
40+ if verbose_import :
4341 pip_args = ["--config-settings=editable-verbose=true" ] + pip_args
4442
45- pip_args = (["-v" ] if verbose else []) + pip_args
43+ if verbose :
44+ pip_args = ["-v" ] + pip_args
4645
4746 _run (pip_cmd + pip_args + ["." ], sys_exit = False , replace = True )
0 commit comments