File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -1404,10 +1404,7 @@ impl RunCommand {
1404
1404
} else if script {
1405
1405
return Ok ( Self :: PythonScript ( target. clone ( ) . into ( ) , args. to_vec ( ) ) ) ;
1406
1406
} else if gui_script {
1407
- if cfg ! ( windows) {
1408
- return Ok ( Self :: PythonGuiScript ( target. clone ( ) . into ( ) , args. to_vec ( ) ) ) ;
1409
- }
1410
- anyhow:: bail!( "`--gui-script` is only supported on Windows. Did you mean `--script`?" ) ;
1407
+ return Ok ( Self :: PythonGuiScript ( target. clone ( ) . into ( ) , args. to_vec ( ) ) ) ;
1411
1408
}
1412
1409
1413
1410
let metadata = target_path. metadata ( ) ;
Original file line number Diff line number Diff line change @@ -2895,7 +2895,7 @@ fn run_script_explicit_directory() -> Result<()> {
2895
2895
2896
2896
#[ test]
2897
2897
#[ cfg( windows) ]
2898
- fn run_gui_script_explicit ( ) -> Result < ( ) > {
2898
+ fn run_gui_script_explicit_windows ( ) -> Result < ( ) > {
2899
2899
let context = TestContext :: new ( "3.12" ) ;
2900
2900
2901
2901
let test_script = context. temp_dir . child ( "script" ) ;
@@ -2932,24 +2932,31 @@ fn run_gui_script_explicit() -> Result<()> {
2932
2932
2933
2933
#[ test]
2934
2934
#[ cfg( not( windows) ) ]
2935
- fn run_gui_script_not_supported ( ) -> Result < ( ) > {
2935
+ fn run_gui_script_explicit_unix ( ) -> Result < ( ) > {
2936
2936
let context = TestContext :: new ( "3.12" ) ;
2937
2937
let test_script = context. temp_dir . child ( "script" ) ;
2938
2938
test_script. write_str ( indoc ! { r#"
2939
2939
# /// script
2940
2940
# requires-python = ">=3.11"
2941
2941
# dependencies = []
2942
2942
# ///
2943
- print("Hello")
2943
+ import sys
2944
+ import os
2945
+
2946
+ executable = os.path.basename(sys.executable).lower()
2947
+ print(f"Using executable: {executable}", file=sys.stderr)
2944
2948
"# } ) ?;
2945
2949
2946
2950
uv_snapshot ! ( context. filters( ) , context. run( ) . arg( "--gui-script" ) . arg( "script" ) , @r###"
2947
- success: false
2948
- exit_code: 2
2951
+ success: true
2952
+ exit_code: 0
2949
2953
----- stdout -----
2950
2954
2951
2955
----- stderr -----
2952
- error: `--gui-script` is only supported on Windows. Did you mean `--script`?
2956
+ Reading inline script metadata from `script`
2957
+ Resolved in [TIME]
2958
+ Audited in [TIME]
2959
+ Using executable: python3
2953
2960
"### ) ;
2954
2961
2955
2962
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments