To help us debug your issue please explain:
Conan: 1.15.0
OS: Ubuntu 18.04
Python: 3.7.1
My recipe wants to inherit its package name and version from a class that knows how to get them, but Conan refuses to create the package because (I believe) it uses astroid to parse the recipe script and see if there is a name and version attribute set directly on the recipe class. Please just run the recipe and fail if there really is no name or version.
# test.py
from conans import ConanFile
class Foo:
name = 'foo'
version = '1.2.3'
class Recipe(Foo, ConanFile):
pass
$ conan create test.py demo/testing
ERROR: conanfile didn't specify name
$ python -c 'import test; print(test.Recipe.name); print(test.Recipe.version)'
foo
1.2.3
I shouldn't have to do this.
# fixed.py
from conans import ConanFile
class Foo:
name = 'foo'
version = '1.2.3'
class Recipe(Foo, ConanFile):
name = Foo.name
version = Foo.version
To help us debug your issue please explain:
Conan: 1.15.0
OS: Ubuntu 18.04
Python: 3.7.1
My recipe wants to inherit its package name and version from a class that knows how to get them, but Conan refuses to create the package because (I believe) it uses
astroidto parse the recipe script and see if there is anameandversionattribute set directly on the recipe class. Please just run the recipe and fail if there really is no name or version.I shouldn't have to do this.