-
Notifications
You must be signed in to change notification settings - Fork 991
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
[develop2] moving global graph_compute to GraphAPI #12666
Conversation
profile_host, profile_build, lockfile, | ||
remotes, args.update) | ||
else: | ||
deps_graph = conan_api.graph.load_graph_requires(args.requires, args.tool_requires, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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): |
There was a problem hiding this comment.
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? 🤔
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
:)
There was a problem hiding this comment.
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.
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