Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure spec["version"] is a string before trying to expand it #888

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

singiamtel
Copy link
Collaborator

@singiamtel singiamtel commented Nov 19, 2024

Some valid versions defined in the recipe can be parsed as floats
instead (e.g. 1.0)

Fix by @mborisyak

Closes #887

Further discussion here: ShipSoft/shipdist#94

Some valid versions defined in the recipe can be parsed as floats
instead (e.g. 1.0)

Fix by @mborisyak

Further discussion here: ShipSoft/shipdist#94
@@ -123,7 +123,7 @@ def resolve_version(spec, defaults, branch_basename, branch_stream):
defaults_upper = defaults != "release" and "_" + defaults.upper().replace("-", "_") or ""
commit_hash = spec.get("commit_hash", "hash_unknown")
tag = str(spec.get("tag", "tag_unknown"))
return spec["version"] % {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this will work correctly. For example the float 1.00 which might be intended as the version "1.00" will happily convert to "1.0". If you really want to fix this, it needs to be done at the level of the parser which should always consider "version" to be followed by a string.

Copy link
Member

@ktf ktf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work, see inline comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A build results in formatting error
2 participants