File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 8
8
from path import Path
9
9
10
10
from setuptools .config .pyprojecttoml import (
11
+ _ToolsTypoInMetadata ,
11
12
read_configuration ,
12
13
expand_configuration ,
13
14
apply_configuration ,
@@ -369,3 +370,28 @@ def test_include_package_data_in_setuppy(tmp_path):
369
370
assert dist .get_name () == "myproj"
370
371
assert dist .get_version () == "42"
371
372
assert dist .include_package_data is False
373
+
374
+
375
+ def test_warn_tools_typo (tmp_path ):
376
+ """Test that the common ``tools.setuptools`` typo in ``pyproject.toml`` issues a warning
377
+
378
+ See https://github.com/pypa/setuptools/issues/4150
379
+ """
380
+ config = """
381
+ [build-system]
382
+ requires = ["setuptools"]
383
+ build-backend = "setuptools.build_meta"
384
+
385
+ [project]
386
+ name = "myproj"
387
+ version = '42'
388
+
389
+ [tools.setuptools]
390
+ packages = ["package"]
391
+ """
392
+
393
+ pyproject = tmp_path / "pyproject.toml"
394
+ pyproject .write_text (cleandoc (config ), encoding = "utf-8" )
395
+
396
+ with pytest .warns (_ToolsTypoInMetadata ):
397
+ expanded = read_configuration (pyproject )
You can’t perform that action at this time.
0 commit comments