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)
1414endif ()
1515
1616# 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
22
3- import sys
3+ from pathlib import Path
44
5- print(f"Ran script 1 from {sys.executable}" )
5+ print (Path ( __file__ ). resolve () )
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import sys
34from pathlib import Path
45
6+ import pytest
7+
58DIR = Path (__file__ ).parent
69PROJECT_DIR = DIR / "packages" / "custom_cmake"
710
@@ -10,4 +13,12 @@ def test_ep(isolated):
1013 isolated .install ("hatchling" , "scikit-build-core[pyproject]" )
1114 isolated .install (PROJECT_DIR / "extern" , isolated = False )
1215 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