[2.0] [feature/feedback] conans.model.version.Version needs to be converted to str
See original GitHub issueWhen downloading source using conan.tools.files.get
, we are using the conandata.yml to store url depending on the recipe version.
This result in this pattern:
class MyPackageConan(ConanFile):
name = "my-package"
version = "1.0.0"
def source(self):
files.get(self, **self.conan_data["sources"][self.version], strip_root=True)
However, in this case, conan will complain with this error:
ERROR: my-package/1.0.0: Error in source() method, line 20
files.get(self, **self.conan_data["sources"][self.version], strip_root=True)
KeyError: 1.0.0
Proposition:
Make Version
convert to str as we had for 1.0.
- I’ve read the CONTRIBUTING guide.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
conan-server version 2.0.0b3 does not start #12128 - GitHub
This is a conan 2.0.0-beta issue. I hope, this issue tracker is for 2.0 development issues, too. (Haven't found any information about ...
Read more >Conan migration guide to 2.0 — conan 1.53.0 documentation
The recipes have to be updated to be compatible with Conan 2.0. There are 2.0 features ported to Conan 1.X so you can...
Read more >Conan API - GitLab Docs
This is the API documentation for Conan Packages. This API is used by the Conan ... package_version, string, yes, Version of a package....
Read more >Botpress can process the user uploaded file? - IssueHint
YOU MAY BE INTERESTED ; Correction on SQL call, 2, 2021-11-18 ; [2.0] [feature/feedback] conans.model.version.Version needs to be converted to str ...
Read more >[2.0] [feature/feedback] conans.model.version.Version needs to be ...
Make Version convert to str as we had for 1.0. To clarify, you want the new Version class to have a __str__ method,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Implemented in https://github.com/conan-io/conan/pull/10519, to be in next alpha 4
We have discussed this, and we have decided to leave the “str” type as base. People wanting to use
self.version
for full comparisons can:Version(self.version)
self.ref.version