File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -14,4 +14,4 @@ if(NOT EXAMPLE_INCLUDE_FOUND)
14
14
endif ()
15
15
16
16
# Testing scripts
17
- install (FILES scripts/script1 DESTINATION "${SKBUILD_SCRIPTS_DIR} " )
17
+ install (PROGRAMS scripts/script1 DESTINATION "${SKBUILD_SCRIPTS_DIR} " )
Original file line number Diff line number Diff line change 1
- #/usr/bin/env python3
1
+ #! /usr/bin/env python3
2
2
3
- import sys
3
+ from pathlib import Path
4
4
5
- print(f"Ran script 1 from {sys.executable}" )
5
+ print (Path ( __file__ ). resolve () )
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
+ import sys
3
4
from pathlib import Path
4
5
6
+ import pytest
7
+
5
8
DIR = Path (__file__ ).parent
6
9
PROJECT_DIR = DIR / "packages" / "custom_cmake"
7
10
@@ -10,4 +13,12 @@ def test_ep(isolated):
10
13
isolated .install ("hatchling" , "scikit-build-core[pyproject]" )
11
14
isolated .install (PROJECT_DIR / "extern" , isolated = False )
12
15
isolated .install (PROJECT_DIR , "-v" , isolated = False )
13
- # Needs script fix: assert isolated.run("script1") == ""
16
+
17
+ if sys .platform .startswith ("win" ):
18
+ # TODO: maybe figure out how to make this work on windows?
19
+ pytest .skip ("Can't run script on Windows" )
20
+
21
+ script = isolated .run ("script1" , capture = True ).strip ()
22
+ pysys = isolated .execute ("import sys; print(sys.executable)" ).strip ()
23
+ contents = Path (script ).read_text ()
24
+ assert contents .startswith (f"#!{ pysys } " )
You can’t perform that action at this time.
0 commit comments