Skip to content

Commit d511cae

Browse files
committed
[WIP] Move pybind11 to its own extra
1 parent 5f78d8f commit d511cae

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ test = [
7878
"cattrs >=22.2.0",
7979
"pip>=23; python_version<'3.13'",
8080
"pip>=24.1; python_version>='3.13'",
81-
"pybind11 >=2.11",
8281
"pytest >=7.2",
8382
"pytest-subprocess >=1.5",
8483
'pytest-xdist >=3.1',
@@ -110,6 +109,10 @@ test-schema = [
110109
"fastjsonschema",
111110
"validate-pyproject",
112111
]
112+
test-pybind11 = [
113+
{ include-group = "test" },
114+
"pybind11 >=2.11",
115+
]
113116
cov = [
114117
{ include-group = "test" },
115118
"pytest-cov",
@@ -119,6 +122,7 @@ dev = [
119122
{ include-group = "test-hatchling" },
120123
{ include-group = "test-meta" },
121124
{ include-group = "test-numpy" },
125+
{ include-group = "test-pybind11" },
122126
{ include-group = "test-schema" },
123127
"rich",
124128
]

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,11 @@ def find_spec(name: str, package: str | None = None) -> Any:
374374
monkeypatch.setattr(importlib.util, "find_spec", find_spec)
375375

376376

377+
@pytest.fixture
378+
def pybind11():
379+
return pytest.importorskip("pybind11")
380+
381+
377382
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
378383
for item in items:
379384
# Ensure all tests using virtualenv are marked as such

tests/test_pyproject_pep517.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def test_passing_cxx_flags(monkeypatch, env_var, setting, tmp_path: Path):
197197
@pytest.mark.compile
198198
@pytest.mark.configure
199199
@pytest.mark.usefixtures("package_simple_pyproject_ext")
200+
@pytest.mark.usefixtures("pybind11")
200201
def test_pep517_wheel(virtualenv, tmp_path: Path):
201202
dist = tmp_path / "dist"
202203
out = build_wheel(
@@ -249,6 +250,7 @@ def test_pep517_wheel(virtualenv, tmp_path: Path):
249250
@pytest.mark.compile
250251
@pytest.mark.configure
251252
@pytest.mark.usefixtures("package_simple_pyproject_source_dir")
253+
@pytest.mark.usefixtures("pybind11")
252254
def test_pep517_wheel_source_dir(virtualenv, tmp_path: Path):
253255
dist = tmp_path / "dist"
254256
out = build_wheel(str(dist), config_settings={"skbuild.wheel.build-tag": "1foo"})

tests/test_setuptools_pep517.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def test_pep517_sdist(tmp_path: Path):
6969
@pytest.mark.configure
7070
@pytest.mark.broken_on_urct
7171
@pytest.mark.usefixtures("package_simple_setuptools_ext")
72+
@pytest.mark.usefixtures("pybind11")
7273
def test_pep517_wheel(virtualenv, tmp_path: Path):
7374
dist = tmp_path / "dist"
7475
out = build_wheel(str(dist))
@@ -149,6 +150,7 @@ def test_toml_sdist(tmp_path: Path):
149150
@pytest.mark.compile
150151
@pytest.mark.configure
151152
@pytest.mark.usefixtures("package_toml_setuptools_ext")
153+
@pytest.mark.usefixtures("pybind11")
152154
@pytest.mark.skipif(
153155
setuptools_version < Version("61.0"), reason="Requires setuptools 61+"
154156
)
@@ -183,6 +185,7 @@ def test_toml_wheel(virtualenv, tmp_path: Path):
183185
@pytest.mark.compile
184186
@pytest.mark.configure
185187
@pytest.mark.usefixtures("package_mixed_setuptools")
188+
@pytest.mark.usefixtures("pybind11")
186189
def test_mixed_wheel(virtualenv, tmp_path: Path):
187190
dist = tmp_path / "dist"
188191
out = build_wheel(str(dist))

0 commit comments

Comments
 (0)