conan-io / docs

conan.io reStructuredText documentation
http://docs.conan.io
MIT License
110 stars 361 forks source link

[question] docs of tool_require custom generators is different from implementation #3902

Closed X1aomu closed 6 days ago

X1aomu commented 6 days ago

What is your question?

I'm trying to migrate my custom generators to the tool_require style, which is an awesome feaature I think💗️ :)

But I noticed that the example given in docs dosen't work at all.

The docs says:

    def package_info(self):
        self.generators_info.append(MyGenerator)

But:

  1. generators_info is actually generator_info
  2. append(MyGenerator) will cause exception as generator_info is initialize to be None, not an array

What's more, the release note says:

Feature: Add self.generators_info for tool_requires to propagate generators to their direct dependencies.

The question is, which side should have a fix, the docs or the code?

These are related PRs:

Have you read the CONTRIBUTING guide?

czoido commented 6 days ago

Hi @X1aomu,

Thanks a lot for reporting and thank you for your kind words. Yes, there's a mismatch between the docs and changelog and the implementation, this should be corrected in the docs, so I'm transferring this issue to the Conan docs repo and will modify the release notes as well.

memsharded commented 6 days ago

This has been closed by https://github.com/conan-io/docs/pull/3903, thanks again for your feedback!

X1aomu commented 5 days ago

Thank you all for quick fix :)

There's one more problem. Ingenerate() function, simply calling self.generator_info.append(MyGenerator) will fail. I don't know whether it is expected to work or not. If not, we should replace it with self.generator_info = [MyGenerator].