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
48
48
pip install sphinx
49
49
prun spin docs
50
50
51
+
51
52
# # Platform specialized tests
52
53
53
54
if [[ $PLATFORM == linux ]]; then
57
58
# if [[ $PLATFORM == darwin ]]; then
58
59
59
60
# 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'
28
28
"Build" = [
29
29
" spin.cmds.meson.build" ,
30
30
" spin.cmds.meson.test" ,
31
- " spin.cmds.build.sdist"
31
+ " spin.cmds.build.sdist" ,
32
+ " spin.cmds.pip.install" ,
32
33
]
33
34
"Documentation" = [
34
35
" spin.cmds.meson.docs"
@@ -44,3 +45,6 @@ package = 'example_pkg'
44
45
" spin.cmds.meson.lldb"
45
46
]
46
47
"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