@@ -19,10 +19,30 @@ def top_level_dir() -> Path:
1919
2020
2121@pytest .fixture (scope = "session" )
22- def buildenv (tmp_path_factory : pytest .TempPathFactory ) -> VEnv :
22+ def wheelhouse (tmp_path_factory : pytest .TempPathFactory ) -> Path :
23+ return tmp_path_factory .mktemp ("wheelhouse" )
24+
25+
26+ @pytest .fixture (scope = "session" )
27+ def buildenv (tmp_path_factory : pytest .TempPathFactory , top_level_dir : Path , wheelhouse : Path ) -> VEnv :
2328 path = tmp_path_factory .mktemp ("cmake_env" )
2429 venv = VEnv (path )
30+ # install cmake in the venv as it is used as a python module
2531 venv .install ("cmake" )
32+ # fill wheelhouse with all required wheels
33+ # This enable this project to be always the current source, not from a remote index
34+ # This also serves as a manual cache, making everything faster when running all tests
35+ # All builds must use: "--find-links", wheelhouse.as_posix(), "--no-index"
36+ venv .module ("pip" , "wheel" ,
37+ "cmake" ,
38+ "scikit-build-core" ,
39+ "hatchling" ,
40+ "vtk==9.6.0" ,
41+ "vtk-sdk==9.6.0" ,
42+ top_level_dir .as_posix (),
43+ "--extra-index-url" , "https://vtk.org/files/wheel-sdks" ,
44+ "--wheel-dir" , wheelhouse .as_posix ()
45+ )
2646 return venv
2747
2848
@@ -58,51 +78,34 @@ def dependency(buildenv: VEnv, tmp_path_factory: pytest.TempPathFactory, curdir:
5878
5979
6080@pytest .fixture (scope = "session" )
61- def wheelhouse (tmp_path_factory : pytest .TempPathFactory ) -> Path :
62- return tmp_path_factory .mktemp ("wheelhouse" )
63-
64-
65- @pytest .fixture (scope = "session" )
66- def vtksdk_helper (buildenv : VEnv , top_level_dir : Path , wheelhouse : Path ) -> None :
67- buildenv .module (
68- "pip" , "wheel" , top_level_dir .as_posix (),
69- "--wheel-dir" , wheelhouse .as_posix ()
70- )
71- assert list (wheelhouse .glob ("vtk_sdk_python_wheel_helper-*.whl" ))
72-
73-
74- @pytest .fixture (scope = "session" )
75- def basic_project (buildenv : VEnv , curdir : Path , dependency : str , wheelhouse : Path , vtksdk_helper ) -> None :
81+ def basic_project (buildenv : VEnv , curdir : Path , dependency : str , wheelhouse : Path ) -> None :
7682 os .environ ["Dependency_ROOT" ] = dependency
7783
7884 basic_project_src = (curdir / "BasicProject" ).as_posix ()
7985 buildenv .module (
8086 "pip" , "wheel" , basic_project_src ,
8187 "--wheel-dir" , wheelhouse .as_posix (),
8288 "--find-links" , wheelhouse .as_posix (),
83- "--extra-index-url" , "https://vtk.org/files/wheel-sdks" ,
84- "--extra-index-url" , "https://wheels.vtk.org"
89+ "--no-index"
8590 )
8691 assert list (wheelhouse .glob ("basic_project-*.whl" ))
8792
8893
8994@pytest .fixture (scope = "session" )
90- def basic_project_sdk (buildenv : VEnv , curdir : Path , dependency : str , wheelhouse : Path , vtksdk_helper ) -> None :
95+ def basic_project_sdk (buildenv : VEnv , curdir : Path , dependency : str , wheelhouse : Path ) -> None :
9196 os .environ ["Dependency_ROOT" ] = dependency
9297
9398 basic_project_src = (curdir / "BasicProject" / "SDK" ).as_posix ()
9499 buildenv .module (
95100 "pip" , "wheel" , basic_project_src ,
96101 "--wheel-dir" , wheelhouse .as_posix (),
97102 "--find-links" , wheelhouse .as_posix (),
98- "--extra-index-url" , "https://vtk.org/files/wheel-sdks" ,
99- "--extra-index-url" , "https://wheels.vtk.org"
103+ "--no-index"
100104 )
101- assert list (wheelhouse .glob ("basic_project_sdk-*.whl" ))
102105
103106
104107# tmp virtualenv for the test projects
105108@pytest .fixture ()
106- def virtualenv (tmp_path : Path , top_level_dir : Path ) -> VEnv :
109+ def virtualenv (tmp_path : Path , buildenv ) -> VEnv :
107110 path = tmp_path / "venv"
108- return VEnv (path )
111+ return VEnv (path )
0 commit comments