You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've specified the Conan version, operating system version and any tool that can be relevant.
I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.
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.
This has a reason: inheriting automatically the name and version of a base class was very confusing and problematic, because the main case of inheriting a base class is via python_requires, and in that case, the name and version are the name and version of the python-require'd package, which is not what you want.
I think allowing this would be breaking behavior for those users and cannot be changed, unless until the python-requires issue (#4635) has been addressed (and no earlier than Conan 2.0, to be able to change this)
deftest(self):
c=TestClient()
conanfile=textwrap.dedent(""" from conan import ConanFile class Foo: name = 'foo' version = '1.2.3' class Recipe(Foo, ConanFile): pass """)
c.save({"conanfile.py": conanfile})
c.run("create .")
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 aname
andversion
attribute 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.
The text was updated successfully, but these errors were encountered: