← Back to issue list

Numerical value for 'source-tag' key causes confusing error

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1612373
Type
issue
State
open
Author
~wesley-wiedenmeier
Labels
yaml
Created
Updated
Closed
—

Current evaluation

Numeric source-tag values must be quoted to avoid YAML float truncation; typed models now appear to reject them cleanly, but no explicit resolution is recorded.

Suggested action: keep open

Reason: A maintainer confirmed that 2.10 would become 2.1, agreed the resulting error was terrible, and proposed schema-level validation; the current craft-parts model types source-tag as a string and application validation formats Pydantic errors, suggesting the behavior may now be addressed. However, no resolving commit, PR, or release was found, so closing the acknowledged usability issue is not justified.

Evaluated by: mr-cal-bot

Impact: 30 Quick Win: 16 Complexity: 35 Confidence: 78 Actionability: 82

Issue body

Many projects on github have numerical tags that represent a release version. The most obvious way to pull a specific revision of something is to use something like 'source-tag: 2.14'. However, this fails with the message: 'Can't convert 'float' object to str implicitly' The same snapcraft configuration file works as expected if the tag is enclosed in quotes, but it would be nice to not require the user to put quotes around the tag. It should work perfectly fine to add a call to str() in snapcraft.internal.sources.Base.__init__ Also, if this is something that won't be fixed, then either the error should be caught and a more helpful error message should be displayed, or a stacktrace should be displayed to make it easier to track the issue down. There is an example snapcraft configuration file attached that demonstrates the bug.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 30
Quick Win: 16
Complexity: 35
Confidence: 78
Actionability: 82
keep open Numeric source-tag values must be quoted to avoid YAML float truncation; typed models now appear to reject them cleanly, but no explicit resolution is recorded.
stealth/space-bunny-alpha
Impact: 25
Quick Win: 11
Complexity: 45
Confidence: 86
Actionability: 80
close not a bug Unquoted version-like source-tag values can produce opaque errors; current craft-parts enforces string validation, but the diagnostic may still need improvement.
qwen/qwen3.6-35b-a3b
Impact: 0
Quick Win: 0
Complexity: 0
Confidence: 95
Actionability: 100
close resolved Numerical source-tag values cause a Python 2 type error; resolved by migration to craft-parts with Pydantic validation which handles type coercion.
qwen/qwen3.8-27b
Impact: 25
Quick Win: 19
Staleness: 90
Complexity: 25
Confidence: 70
Support Request: 15
close stale Unquoted numeric source-tag (e.g., 2.14) in snapcraft.yaml caused a confusing 'Can't convert float to str' error. No comments, no activity for ~7.7 years. The snapcraft.internal.sources code path no longer exists after the 2.x rewrite.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 15
Confidence: 90
Support Request: 5
close stale Numerical values in the source-tag YAML key cause a Python type conversion error. Issue is nearly 10 years old with no maintainer response or activity for over 7 years.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 25
Confidence: 90
Support Request: 10
close stale Numerical values in the source-tag YAML key cause a Python type conversion error. The report is over 9 years old with nearly 8 years of inactivity and no maintainer engagement.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 10
Confidence: 70
Support Request: 5
close stale Unquoted numerical values in the source-tag config key trigger a confusing Python float-to-str conversion error. The issue has seen no maintainer interaction or resolution in nearly a decade.

Update history

Date Change
created

Related issues

No related issues found above the similarity threshold.