Conan version: 2.0.13
I have a conan recipe where I define the set_version()
method to set my package version based on an external script.
When I try to generate the package by doing
conan create .
I get the next error:
ERROR: conanfile didn't specify version
It seems that I must use --version
flag for it to work and that set_version()
is not called.
--version
is an optional parameter ofconan
set_version()
method is defined inconanfile
- For what I know,
set_version()
will be automatically called when doingconan create
orconan export
What am I missing?
(EDIT)
def set_version(self):
if self.version:
return
version_script = self.recipe_folder / "scripts" / "version"
self.version = check_output([version_script], text=True).strip()