1- import shutil
21import sys
32from pathlib import Path
43
54import pytest
6- from conftest import PackageInfo , VEnv , process_package
5+ from conftest import PackageInfo , process_package
76
87
98@pytest .mark .compile ()
@@ -58,9 +57,7 @@ def test_navigate_editable(isolated, isolate, package):
5857@pytest .mark .parametrize (
5958 ("editable" , "editable_mode" ), [(False , "" ), (True , "redirect" ), (True , "inplace" )]
6059)
61- def test_cython_pxd (monkeypatch , tmp_path , editable , editable_mode ):
62- env_path = tmp_path / "env"
63- env = VEnv (env_path )
60+ def test_cython_pxd (monkeypatch , tmp_path , editable , editable_mode , isolated ):
6461 editable_flag = ["-e" ] if editable else []
6562
6663 config_mode_flags = []
@@ -69,40 +66,34 @@ def test_cython_pxd(monkeypatch, tmp_path, editable, editable_mode):
6966 if editable_mode != "inplace" :
7067 config_mode_flags .append ("--config-settings=build-dir=build/{wheel_tag}" )
7168
72- try :
73- package1 = PackageInfo (
74- "cython_pxd_editable/pkg1" ,
75- )
76- tmp_path1 = tmp_path / "pkg1"
77- tmp_path1 .mkdir ()
78- process_package (package1 , tmp_path1 , monkeypatch )
79-
80- env .install ("pip>=23" )
81- env .install ("cython" )
82- env .install ("scikit-build-core[pyproject]" )
83- env .install ("ninja" )
84-
85- env .install (
86- "-v" ,
87- * config_mode_flags ,
88- "--no-build-isolation" ,
89- * editable_flag ,
90- "." ,
91- )
92-
93- package2 = PackageInfo (
94- "cython_pxd_editable/pkg2" ,
95- )
96- tmp_path2 = tmp_path / "pkg2"
97- tmp_path2 .mkdir ()
98- process_package (package2 , tmp_path2 , monkeypatch )
99-
100- env .install (
101- "-v" ,
102- * config_mode_flags ,
103- "--no-build-isolation" ,
104- * editable_flag ,
105- "." ,
106- )
107- finally :
108- shutil .rmtree (env_path , ignore_errors = True )
69+ package1 = PackageInfo (
70+ "cython_pxd_editable/pkg1" ,
71+ )
72+ tmp_path1 = tmp_path / "pkg1"
73+ tmp_path1 .mkdir ()
74+ process_package (package1 , tmp_path1 , monkeypatch )
75+
76+ isolated .install ("pip>23" , "cython" , "scikit-build-core[pyproject]" )
77+
78+ isolated .install (
79+ "-v" ,
80+ * config_mode_flags ,
81+ "--no-build-isolation" ,
82+ * editable_flag ,
83+ "." ,
84+ )
85+
86+ package2 = PackageInfo (
87+ "cython_pxd_editable/pkg2" ,
88+ )
89+ tmp_path2 = tmp_path / "pkg2"
90+ tmp_path2 .mkdir ()
91+ process_package (package2 , tmp_path2 , monkeypatch )
92+
93+ isolated .install (
94+ "-v" ,
95+ * config_mode_flags ,
96+ "--no-build-isolation" ,
97+ * editable_flag ,
98+ "." ,
99+ )
0 commit comments