We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The code in charmcraft 2.0 looks like this:
output = self._execute("charm version").strip() _, tools_version = output.split("\n")
And our current compatibility code look like this:
charm-tools/charmtools/version.py
Lines 70 to 75 in e1c7ee0
Due to charmcraft's use of strip as opposed to rstrip, this does not work.
Example:
>>> s = subprocess.run(["/bin/bash", "-c", "charm version"], check=True, capture_output=True, universal_newlines=True) >>> s CompletedProcess(args=['/bin/bash', '-c', 'charm version'], returncode=0, stdout='\ncharm-tools 3.0.0+snap-661+git-1-b7025b2\n', stderr='') >>> s.stdout.strip() 'charm-tools 3.0.0+snap-661+git-1-b7025b2'
Now if we fudge the output by adding something on the first line:
>>> s = subprocess.run(["/bin/bash", "-c", "charm version"], check=True, capture_output=True, universal_newlines=True) >>> s CompletedProcess(args=['/bin/bash', '-c', 'charm version'], returncode=0, stdout='-\ncharm-tools 3.0.0+snap-x1+git-3-e1c7ee0\n', stderr='') >>> s.stdout.strip() '-\ncharm-tools 3.0.0+snap-x1+git-3-e1c7ee0' >>> _, tools_version = s.stdout.strip().split('\n') >>> tools_version 'charm-tools 3.0.0+snap-x1+git-3-e1c7ee0'
The text was updated successfully, but these errors were encountered:
Fix version output to be compatbile with sibling projects
1af2d58
Due to how some other projects parse our version string the current format may break people. Fixes juju#636
Fix version output to be compatbile with sibling projects (#637)
d56d76b
Due to how some other projects parse our version string the current format may break people. Fixes #636
Successfully merging a pull request may close this issue.
The code in charmcraft 2.0 looks like this:
And our current compatibility code look like this:
charm-tools/charmtools/version.py
Lines 70 to 75 in e1c7ee0
Due to charmcraft's use of strip as opposed to rstrip, this does not work.
Example:
Now if we fudge the output by adding something on the first line:
The text was updated successfully, but these errors were encountered: