24
24
from .conftest import WHEELS , PYODIDE_KERNEL_EXTENSION
25
25
26
26
27
- def has_wheel_after_build (an_empty_lite_dir , script_runner ):
27
+ def has_wheel_after_build (an_empty_lite_dir , script_runner , cli_args = None ):
28
28
"""run a build, expecting the fixture wheel to be there"""
29
- build = script_runner .run (["jupyter" , "lite" , "build" ], cwd = str (an_empty_lite_dir ))
29
+ cli_args = cli_args or []
30
+ build = script_runner .run (
31
+ ["jupyter" , "lite" , "build" , * cli_args ], cwd = str (an_empty_lite_dir )
32
+ )
30
33
assert build .success
31
34
32
- check = script_runner .run (["jupyter" , "lite" , "check" ], cwd = str (an_empty_lite_dir ))
35
+ check = script_runner .run (
36
+ ["jupyter" , "lite" , "check" , * cli_args ], cwd = str (an_empty_lite_dir )
37
+ )
33
38
assert check .success
34
39
35
40
output = an_empty_lite_dir / "_output"
@@ -47,12 +52,13 @@ def has_wheel_after_build(an_empty_lite_dir, script_runner):
47
52
assert WHEELS [0 ].name in wheel_index_text , wheel_index_text
48
53
49
54
55
+ @mark .parametrize ("by_cli" , [0 , 1 , 2 ])
50
56
@mark .parametrize (
51
57
"remote,folder" ,
52
58
[[True , False ], [False , False ], [False , True ]],
53
59
)
54
60
def test_piplite_urls (
55
- an_empty_lite_dir , script_runner , remote , folder , a_fixture_server
61
+ by_cli , remote , folder , an_empty_lite_dir , script_runner , a_fixture_server
56
62
):
57
63
"""can we include a single wheel?"""
58
64
ext = WHEELS [0 ]
@@ -75,15 +81,20 @@ def test_piplite_urls(
75
81
"federated_extensions" : [
76
82
str (PYODIDE_KERNEL_EXTENSION ),
77
83
],
78
- },
79
- "PipliteAddon" : {
80
- "piplite_urls" : piplite_urls ,
81
- },
84
+ }
82
85
}
83
86
87
+ if by_cli == 0 :
88
+ cli_args = []
89
+ config .update (PipliteAddon = {"piplite_urls" : piplite_urls })
90
+ elif by_cli == 1 :
91
+ cli_args = ["--piplite-wheels" , piplite_urls [0 ]]
92
+ elif by_cli == 2 :
93
+ cli_args = ["--piplite-wheels" , piplite_urls [0 ], "--piplite-wheels" , "." ]
94
+
84
95
(an_empty_lite_dir / "jupyter_lite_config.json" ).write_text (json .dumps (config ))
85
96
86
- has_wheel_after_build (an_empty_lite_dir , script_runner )
97
+ has_wheel_after_build (an_empty_lite_dir , script_runner , cli_args )
87
98
88
99
89
100
def test_lite_dir_wheel (an_empty_lite_dir , script_runner ):
0 commit comments