@@ -739,7 +739,7 @@ def test_git_archival_plugin_ignored(tmp_path: Path, ep_name: str) -> None:
739
739
740
740
741
741
def test_pyproject_build_system_requires_setuptools_scm (wd : WorkDir ) -> None :
742
- """Test that setuptools_scm is enabled when present in build-system.requires """
742
+ """With only build-system.requires and dynamic version, no auto-enable without tool section. """
743
743
if sys .version_info < (3 , 11 ):
744
744
pytest .importorskip ("tomli" )
745
745
@@ -761,13 +761,13 @@ def test_pyproject_build_system_requires_setuptools_scm(wd: WorkDir) -> None:
761
761
wd .write ("setup.py" , "__import__('setuptools').setup()" )
762
762
763
763
res = wd ([sys .executable , "setup.py" , "--version" ])
764
- assert res . endswith ( "0.1.dev0+d20090213" )
764
+ assert res == "0.0.0"
765
765
766
766
767
767
def test_pyproject_build_system_requires_setuptools_scm_dash_variant (
768
768
wd : WorkDir ,
769
769
) -> None :
770
- """Test that setuptools-scm (dash variant) is also detected in build-system.requires """
770
+ """Dash variant also does not auto-enable without tool section. """
771
771
if sys .version_info < (3 , 11 ):
772
772
pytest .importorskip ("tomli" )
773
773
@@ -789,9 +789,12 @@ def test_pyproject_build_system_requires_setuptools_scm_dash_variant(
789
789
wd .write ("setup.py" , "__import__('setuptools').setup()" )
790
790
791
791
res = wd ([sys .executable , "setup.py" , "--version" ])
792
- assert res . endswith ( "0.1.dev0+d20090213" )
792
+ assert res == "0.0.0"
793
793
794
794
795
+ @pytest .mark .xfail (
796
+ reason = "we currently dont support dynamic version without tool section"
797
+ )
795
798
def test_pyproject_build_system_requires_with_extras (wd : WorkDir ) -> None :
796
799
"""Test that setuptools_scm[toml] is detected in build-system.requires"""
797
800
if sys .version_info < (3 , 11 ):
@@ -847,7 +850,7 @@ def test_pyproject_build_system_requires_not_present(wd: WorkDir) -> None:
847
850
def test_pyproject_build_system_requires_priority_over_tool_section (
848
851
wd : WorkDir ,
849
852
) -> None :
850
- """Test that both build-system.requires and [tool.setuptools_scm] section work together """
853
+ """Tool section controls enablement; build-system.requires may coexist. """
851
854
if sys .version_info < (3 , 11 ):
852
855
pytest .importorskip ("tomli" )
853
856
@@ -887,7 +890,7 @@ def test_extract_package_name(base_name: str, requirements: str) -> None:
887
890
888
891
889
892
def test_build_requires_integration_with_config_reading (wd : WorkDir ) -> None :
890
- """Test that Configuration.from_file handles build-system.requires automatically """
893
+ """Configuration.from_file still accepts build-system.requires without tool section. """
891
894
if sys .version_info < (3 , 11 ):
892
895
pytest .importorskip ("tomli" )
893
896
@@ -1092,6 +1095,9 @@ def test_integration_function_call_order(
1092
1095
)
1093
1096
1094
1097
1098
+ @pytest .mark .xfail (
1099
+ reason = "we currently dont support dynamic version without tool section"
1100
+ )
1095
1101
def test_infer_version_with_build_requires_no_tool_section (
1096
1102
wd : WorkDir , monkeypatch : pytest .MonkeyPatch
1097
1103
) -> None :
@@ -1119,14 +1125,14 @@ def test_infer_version_with_build_requires_no_tool_section(
1119
1125
# Call infer_version with direct data injection - no file I/O!
1120
1126
infer_version (dist , _given_pyproject_data = pyproject_data )
1121
1127
1122
- # Verify that version was set
1123
- assert dist .metadata .version is not None
1124
1128
assert dist .metadata .version == "1.0.0"
1125
1129
1126
- # Verify that the marker was set
1127
1130
assert getattr (dist , "_setuptools_scm_version_set_by_infer" , False ) is True
1128
1131
1129
1132
1133
+ @pytest .mark .xfail (
1134
+ reason = "we currently dont support dynamic version without tool section"
1135
+ )
1130
1136
def test_infer_version_with_build_requires_dash_variant_no_tool_section (
1131
1137
wd : WorkDir , monkeypatch : pytest .MonkeyPatch
1132
1138
) -> None :
@@ -1154,11 +1160,8 @@ def test_infer_version_with_build_requires_dash_variant_no_tool_section(
1154
1160
# Call infer_version with direct data injection - no file I/O!
1155
1161
infer_version (dist , _given_pyproject_data = pyproject_data )
1156
1162
1157
- # Verify that version was set
1158
- assert dist .metadata .version is not None
1159
1163
assert dist .metadata .version == "1.0.0"
1160
1164
1161
- # Verify that the marker was set
1162
1165
assert getattr (dist , "_setuptools_scm_version_set_by_infer" , False ) is True
1163
1166
1164
1167
@@ -1221,6 +1224,9 @@ def test_version_keyword_no_scm_dependency_works(
1221
1224
assert dist .metadata .version == "1.0.0"
1222
1225
1223
1226
1227
+ @pytest .mark .xfail (
1228
+ reason = "we currently dont support dynamic version without tool section"
1229
+ )
1224
1230
def test_verify_dynamic_version_when_required_missing_dynamic () -> None :
1225
1231
"""Test that should_infer raises ValueError when setuptools-scm is in build-system.requires but dynamic=['version'] is missing"""
1226
1232
from setuptools_scm ._integration .pyproject_reading import PyProjectData
@@ -1261,6 +1267,9 @@ def test_verify_dynamic_version_when_required_with_tool_section() -> None:
1261
1267
assert pyproject_data .should_infer () is True
1262
1268
1263
1269
1270
+ @pytest .mark .xfail (
1271
+ reason = "we currently dont support dynamic version without tool section"
1272
+ )
1264
1273
def test_verify_dynamic_version_when_required_with_dynamic () -> None :
1265
1274
"""Test that verification passes when setuptools-scm is in build-system.requires and dynamic=['version'] is set"""
1266
1275
from setuptools_scm ._integration .pyproject_reading import PyProjectData
0 commit comments