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

[develop2] moving global graph_compute to GraphAPI #12666

Merged
merged 7 commits into from
Dec 12, 2022

Conversation

memsharded
Copy link
Member

It is a bad example for readers of our code that we have a global, free function for something that looks better as part of the PythonAPI

@memsharded memsharded added this to the 2.0.0-beta7 milestone Dec 7, 2022
profile_host, profile_build, lockfile,
remotes, args.update)
else:
deps_graph = conan_api.graph.load_graph_requires(args.requires, args.tool_requires,
Copy link
Contributor

@prince-chrismc prince-chrismc Dec 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 This is much better then and giant function above. I going to open an issue for this since the custom commands I was working on but this address the suggestions I had

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prince-chrismc/conan-center-index@1909a3e

This is much better for UX
image

@memsharded memsharded marked this pull request as ready for review December 9, 2022 12:07
@czoido czoido merged commit 64a64b8 into conan-io:develop2 Dec 12, 2022
@memsharded memsharded deleted the refactor/develop2_graph_compute branch December 12, 2022 10:01
Comment on lines 91 to +92
@api_method
def load_root_virtual_conanfile(self, profile_host, requires=None, tool_requires=None):
def _load_root_virtual_conanfile(self, profile_host, requires=None, tool_requires=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be marked as an API method and have an underscore? I thought underscore meant private function? 🤔

Copy link
Member Author

@memsharded memsharded Dec 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not, the "virtual" conanfile seems a bit of implementation detail, I don't see a clear use case of users having to do that, now that we exposed a load_graph_consumer(path, ...) and load_graph_requires(requires, tool_requires...) methods. We don't need to do it now, lets keep the API minimal to the construction of our own built-in commands, and open it as necessary when requested by users. So this might be good as private at the moment, it will not be part of the public api.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it should be private, thats why I am confused why it's @api_method :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, you are right, that api_method should be removed.

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

Successfully merging this pull request may close these issues.

3 participants