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
We have a bunch of projects, each of them has a project.json file defining common informations about the project. This json file is used by several tools to share informations. We have created some helpers to read this file in order to fill conan attributes. We are looking to hide this kind of processing in a base class (which inherit from ConanFile) inherited by all projects. This base class holds common attributes (name, version, description, ...) and several helpers. We would like to hide as much as we can from the project recipe to have it as simple as possible, specifying only specific stuff of the project we are packaging.
That works pretty well but some commands raise an error saying "ERROR: conanfile didn't specify name". Same error message for the version number. In my case I define name and version attributes in the base class and it's like they cannot be inherited from a base class. As a workaround, I pass the complete package reference on the command line and everything is fine. We execute these commands through CI scripts so we can deal with this behavior.
I would like to know if I am doing something wrong or illegal ? Can we share name, version, ... from a bse class ?
We are indeed using a PythonRequire module. I'll look at the changes of this new version and the feature provided by conan 1.20 (I did my tests with conan 1.19) and I'll come back to you.
I have done some tests using conan 1.20.3, the error is not raised anymore and it works as expected. I didn't have to use the new methods, my implementation works as is. I should have try the latest version before posting my question. Thanks for the improvement.
About PythonRequires, we manage to do what we need. We still need to use it more widdely. We'll come back later with more feedbacks.
We have a bunch of projects, each of them has a project.json file defining common informations about the project. This json file is used by several tools to share informations. We have created some helpers to read this file in order to fill conan attributes. We are looking to hide this kind of processing in a base class (which inherit from ConanFile) inherited by all projects. This base class holds common attributes (name, version, description, ...) and several helpers. We would like to hide as much as we can from the project recipe to have it as simple as possible, specifying only specific stuff of the project we are packaging.
That works pretty well but some commands raise an error saying "ERROR: conanfile didn't specify name". Same error message for the version number. In my case I define name and version attributes in the base class and it's like they cannot be inherited from a base class. As a workaround, I pass the complete package reference on the command line and everything is fine. We execute these commands through CI scripts so we can deal with this behavior.
I would like to know if I am doing something wrong or illegal ? Can we share name, version, ... from a bse class ?
The text was updated successfully, but these errors were encountered: