Skip to content

Commit bf768e0

Browse files
committed
Add experimental warning to ext-modules in pyproject.toml
1 parent 3b1051a commit bf768e0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

setuptools/config/pyprojecttoml.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ def read_configuration(
130130
asdict["tool"] = tool_table
131131
tool_table["setuptools"] = setuptools_table
132132

133+
if "ext-modules" in setuptools_table:
134+
_ExperimentalConfiguration.emit(subject="[tool.setuptools.ext-modules]")
135+
133136
with _ignore_errors(ignore_option_errors):
134137
# Don't complain about unrelated errors (e.g. tools not using the "tool" table)
135138
subset = {"project": project_table, "tool": {"setuptools": setuptools_table}}

setuptools/tests/config/test_apply_pyprojecttoml.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,8 @@ def test_pyproject_sets_attribute(self, tmp_path, monkeypatch):
338338
]
339339
"""
340340
pyproject.write_text(cleandoc(toml_config), encoding="utf-8")
341-
dist = pyprojecttoml.apply_configuration(Distribution({}), pyproject)
341+
with pytest.warns(pyprojecttoml._ExperimentalConfiguration):
342+
dist = pyprojecttoml.apply_configuration(Distribution({}), pyproject)
342343
assert len(dist.ext_modules) == 1
343344
assert dist.ext_modules[0].name == "my.ext"
344345
assert set(dist.ext_modules[0].sources) == {"hello.c", "world.c"}

0 commit comments

Comments
 (0)