Closed uilianries closed 2 years ago
Moreover, we should add a migration check to the linter to use self.info.clear()
instead of self.info.header_only()
@danimtb Yes, but still, this change id needed anyway, otherwise, conan-center hook complains about self.info.clear()
usage.
@uilianries do you have an example of that? did it happen already?
@danimtb Yes: https://github.com/conan-io/conan-center-index/pull/11981#issuecomment-1205022505
I needed to revert to self.info.header_only
because Hooks didn't recognized my recipe as header-only and complained that was missing artifacts.
So self.info.header_only()
is something that should never be used? The linter can just remove it from info
object and syntax will complain
So
self.info.header_only()
is something that should never be used? The linter can just remove it frominfo
object and syntax will complain
As soon as we run Conan 1.50 on CCI, we can apply that rule with the linter.
We are already running 1.50.1
, so it's something we can already add.
I see in Conan codebase:
class ConanInfo(object):
...
# FIXME: Rename this to "clear" in 2.0
def header_only(self):
self.settings.clear()
self.options.clear()
self.requires.clear()
clear = header_only
We are already running 1.50.1, so it's something we can already add.
Yes, just in case you need to revert ... 😏
Anyway, I'm using self.info.clear()
here and Conan Center, including linter, accepted.
According to the migration guide, the
self.info.clear()
should be used to identify header-only recipes.Documentation https://docs.conan.io/en/latest/migrating_to_2.0/recipes.html#the-package-id-method