Skip to content
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] docs of tool_require custom generators is different from implementation #3902

Closed
1 task done
X1aomu opened this issue Nov 20, 2024 · 3 comments
Closed
1 task done
Assignees

Comments

@X1aomu
Copy link
Contributor

X1aomu commented Nov 20, 2024

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?

  • I've read the CONTRIBUTING guide
@X1aomu X1aomu changed the title [question] docs of tool_require custom generators is different from implemenation [question] docs of tool_require custom generators is different from implementation Nov 20, 2024
@czoido czoido self-assigned this Nov 20, 2024
@czoido
Copy link
Contributor

czoido commented Nov 20, 2024

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.

@czoido czoido transferred this issue from conan-io/conan Nov 20, 2024
@memsharded
Copy link
Member

This has been closed by #3903, thanks again for your feedback!

@X1aomu
Copy link
Contributor Author

X1aomu commented Nov 21, 2024

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].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants