File tree Expand file tree Collapse file tree 3 files changed +53
-1
lines changed
Expand file tree Collapse file tree 3 files changed +53
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ prun spin example
4848pip install sphinx
4949prun spin docs
5050
51+
5152# # Platform specialized tests
5253
5354if [[ $PLATFORM == linux ]]; then
5758# if [[ $PLATFORM == darwin ]]; then
5859
5960# if [[ $PLATFORM =~ ^win.* ]]; then
61+
62+
63+ prun spin install
64+ cd /tmp
65+ python -c ' import example_pkg; print(example_pkg.__version__)'
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ package = 'example_pkg'
2828"Build" = [
2929 " spin.cmds.meson.build" ,
3030 " spin.cmds.meson.test" ,
31- " spin.cmds.build.sdist"
31+ " spin.cmds.build.sdist" ,
32+ " spin.cmds.pip.install" ,
3233]
3334"Documentation" = [
3435 " spin.cmds.meson.docs"
@@ -44,3 +45,6 @@ package = 'example_pkg'
4445 " spin.cmds.meson.lldb"
4546]
4647"Extensions" = [" .spin/cmds.py:example" ]
48+ "Install" = [
49+ " spin.cmds.pip.install"
50+ ]
Original file line number Diff line number Diff line change 1+ import click
2+
3+ from .util import run as _run
4+
5+
6+ @click .command ()
7+ @click .option (
8+ "-v" ,
9+ "--verbose" ,
10+ is_flag = True ,
11+ default = False ,
12+ help = "Print detailed build and installation output" ,
13+ )
14+ @click .option (
15+ "--editable/--no-editable" ,
16+ is_flag = True ,
17+ default = True ,
18+ help = "Install in editable mode" ,
19+ )
20+ @click .argument ("pip_args" , nargs = - 1 )
21+ def install (pip_args , verbose , editable ):
22+ """💽 Build and install package using pip.
23+
24+ By default, the package is installed in editable mode.
25+
26+ Arguments after `--` are passed through to pip, e.g.:
27+
28+ spin install -- --no-clean
29+
30+ would translated to:
31+
32+ pip install . --no-build-isolation --editable --no-clean
33+ """
34+ pip_args = list (pip_args )
35+ pip_cmd = ["pip" , "install" ]
36+ pip_args += ["--no-build-isolation" ]
37+ if editable :
38+ pip_args += ["--editable" ]
39+
40+ pip_args = (["-v" ] if verbose else []) + pip_args
41+
42+ _run (pip_cmd + pip_args + ["." ], sys_exit = False , replace = True )
You can’t perform that action at this time.
0 commit comments