Skip to content

Commit 00d42a7

Browse files
remove ai slop in comments
1 parent 3a8ec6c commit 00d42a7

File tree

5 files changed

+5
-15
lines changed

5 files changed

+5
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Breaking
6+
7+
- fix #1019: pass python version build tags from scm version to results propperly
8+
59
### Added
610

711
- add `setuptools-scm` console_scripts entry point to make the CLI directly executable

src/setuptools_scm/_overrides.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ def _read_pretended_version_for(
164164
pretended = read_named_env(name="PRETEND_VERSION", dist_name=config.dist_name)
165165

166166
if pretended:
167-
# Use enhanced meta function - let validation errors bubble up
168167
return version.meta(tag=pretended, preformatted=True, config=config)
169168
else:
170169
return None

src/setuptools_scm/fallbacks.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def parse_pkginfo(root: _t.PathT, config: Configuration) -> ScmVersion | None:
2525
data = data_from_mime(pkginfo)
2626
version = data.get("Version", _UNKNOWN)
2727
if version != _UNKNOWN:
28-
# Use enhanced meta function - let validation errors bubble up
2928
return meta(version, preformatted=True, config=config)
3029
else:
3130
return None
@@ -39,10 +38,8 @@ def fallback_version(root: _t.PathT, config: Configuration) -> ScmVersion | None
3938
parent_name[len(config.parentdir_prefix_version) :], config
4039
)
4140
if version is not None:
42-
# Use enhanced meta function - let validation errors bubble up
4341
return meta(str(version), preformatted=True, config=config)
4442
if config.fallback_version is not None:
4543
log.debug("FALLBACK %s", config.fallback_version)
46-
# Use enhanced meta function - let validation errors bubble up
4744
return meta(config.fallback_version, preformatted=True, config=config)
4845
return None

testing/test_cli.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def test_cli_create_archival_file_stable(
9393
archival_file = wd.cwd / ".git_archival.txt"
9494
assert not archival_file.exists()
9595

96-
# Test successful creation
9796
result = main(["create-archival-file", "--stable"])
9897
assert result == 0
9998
assert archival_file.exists()
@@ -122,7 +121,6 @@ def test_cli_create_archival_file_full(
122121
archival_file = wd.cwd / ".git_archival.txt"
123122
assert not archival_file.exists()
124123

125-
# Test successful creation
126124
result = main(["create-archival-file", "--full"])
127125
assert result == 0
128126
assert archival_file.exists()

testing/test_integration.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,7 @@ def test_pretend_metadata_with_version(
219219

220220
# Test version file template functionality
221221
wd.write("setup.py", SETUP_PY_PLAIN)
222-
wd("mkdir -p src") # Create the src directory
223-
# This is a template string, not an f-string - used by setuptools-scm templating
222+
wd("mkdir -p src")
224223
version_file_content = """
225224
version = '{version}'
226225
major = {version_tuple[0]}
@@ -234,7 +233,6 @@ def test_pretend_metadata_with_version(
234233
write_to="src/version.py", write_to_template=version_file_content
235234
)
236235

237-
# Read the file using pathlib
238236
content = (wd.cwd / "src/version.py").read_text()
239237
assert "commit_hash = 'g1337beef'" in content
240238
assert "num_commit = 4" in content
@@ -266,10 +264,8 @@ def test_pretend_metadata_without_version_warns(
266264
# Let's create an empty git repo without commits to truly have no base version
267265
monkeypatch.setenv(PRETEND_METADATA_KEY, '{node="g1234567", distance=2}')
268266

269-
# Should get a version with fallback but metadata overrides applied
270267
with caplog.at_level(logging.WARNING):
271268
version = wd.get_version()
272-
# Should get a fallback version with metadata overrides
273269
assert version is not None
274270

275271
# In this case, metadata was applied to a fallback version, so no warning about missing base
@@ -301,7 +297,6 @@ def test_pretend_metadata_with_scm_version(
301297
# Test version file to see if metadata was applied
302298
wd.write("setup.py", SETUP_PY_PLAIN)
303299
wd("mkdir -p src")
304-
# This is a template string, not an f-string - used by setuptools-scm templating
305300
version_file_content = """
306301
version = '{version}'
307302
commit_hash = '{scm_version.short_node}'
@@ -403,7 +398,6 @@ def test_git_tag_with_local_build_data_preserved(wd: WorkDir) -> None:
403398
f"Version should parse correctly as PEP 440: {version}"
404399
)
405400

406-
# Should preserve the build metadata that was in the git tag
407401
assert version == "1.0.0+build.123", (
408402
f"Expected build metadata preserved, got {version}"
409403
)
@@ -430,7 +424,6 @@ def test_git_tag_with_commit_hash_preserved(wd: WorkDir) -> None:
430424
f"Version should parse correctly as PEP 440: {version}"
431425
)
432426

433-
# Should preserve the commit hash that was in the git tag
434427
assert version == "2.0.0+sha.abcd1234"
435428

436429
# Validate the local part is correct
@@ -459,7 +452,6 @@ def test_git_tag_with_local_build_data_preserved_dirty_workdir(wd: WorkDir) -> N
459452
f"Version should parse correctly as PEP 440: {version}"
460453
)
461454

462-
# Should preserve the build metadata that was in the git tag
463455
assert version == "1.5.0+build.456", (
464456
f"Expected build metadata preserved with dirty workdir, got {version}"
465457
)

0 commit comments

Comments
 (0)