Skip to content

Commit

Permalink
Add experimental warning to ext-modules in pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Sep 2, 2024
1 parent 3b1051a commit bf768e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions setuptools/config/pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ def read_configuration(
asdict["tool"] = tool_table
tool_table["setuptools"] = setuptools_table

if "ext-modules" in setuptools_table:
_ExperimentalConfiguration.emit(subject="[tool.setuptools.ext-modules]")

with _ignore_errors(ignore_option_errors):
# Don't complain about unrelated errors (e.g. tools not using the "tool" table)
subset = {"project": project_table, "tool": {"setuptools": setuptools_table}}
Expand Down
3 changes: 2 additions & 1 deletion setuptools/tests/config/test_apply_pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ def test_pyproject_sets_attribute(self, tmp_path, monkeypatch):
]
"""
pyproject.write_text(cleandoc(toml_config), encoding="utf-8")
dist = pyprojecttoml.apply_configuration(Distribution({}), pyproject)
with pytest.warns(pyprojecttoml._ExperimentalConfiguration):
dist = pyprojecttoml.apply_configuration(Distribution({}), pyproject)
assert len(dist.ext_modules) == 1
assert dist.ext_modules[0].name == "my.ext"
assert set(dist.ext_modules[0].sources) == {"hello.c", "world.c"}
Expand Down

0 comments on commit bf768e0

Please sign in to comment.