-
Notifications
You must be signed in to change notification settings - Fork 946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Change package_id() function to consider package_id of one dependency #16237
Comments
Hi @MTomBosch I guess you are looking for something like this?: def package_id(self):
self.info.requires["my_dep"].xxx_mode() Where the modes in https://docs.conan.io/1/creating_packages/define_abi_compatibility.html#versioning-schema can tell you which ones do take into account the Is this what you are looking for? |
Partially. Your solution I was already aware of and sorry for not being clear enough that I would not like to use such a solution. Using "full package mode" or "recipe revision mode" for that one particular dependency would create too many new package ids for the consumer which I would like to avoid. I would only like to react on changes to the package id (and the semver of the dependent packages). Is that posssible at all? |
Why? In any case, yes, you should be able to set individual fields like: def package_id(self):
self.info.requires["pkg"].package_id = self.dependencies["pkg"].pref.package_id Or you could use one of the predefined moedes like |
The default package id mode that we use is semver_direct_mode and it does not compute the pkg id based on user and channel but full_package_mode does and this would lead to more package ids. But maybe that is even acceptable, I will check this. And thank you for the other proposal. |
@memsharded Sorry to bother you again. Using the full_package_mode it is working. Now I wanted to try your proposal with the "self.dependencies" but I am getting following error message: AttributeError: 'PackageReference' object has no attribute 'package_id' |
Yes, sorry, my bad, in Conan 1.X it is called |
What is your question?
Hello,
we are using Conan 1 and are using the semver_direct_mode for package_id computation.
Now we have a scenario where for one particular dependency I want to consider also its package_id when computing my own package_id.
Do you have somewhere a code snippet that shows how to accomplish my above goal?
Thank you
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: