Skip to content

Commit 903f951

Browse files
committed
ci: fix tests
Signed-off-by: Henry Schreiner <[email protected]>
1 parent acd305d commit 903f951

File tree

2 files changed

+34
-42
lines changed

2 files changed

+34
-42
lines changed

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def pep518_wheelhouse(tmp_path_factory: pytest.TempPathFactory) -> Path:
5050
)
5151
packages = [
5252
"build",
53+
"cython",
5354
"hatchling",
5455
"pip>=23",
5556
"pybind11",

tests/test_editable.py

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import shutil
21
import sys
32
from pathlib import Path
43

54
import 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

Comments
 (0)