-
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][poc] Checking the [system_tools]
idea
#10166
[develop2][poc] Checking the [system_tools]
idea
#10166
Conversation
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 an interesting idea and simple in code. But probably we are missing corner cases or missing use cases. This would be the typical "experimental" feature I would introduce to test if useful and complete enough but I'm not sure how should we proceed with that kind of experimental feature in an Alpha.
Then I suggest, as a first step, try to build a bit more exhaustive test suite for this feature, trying to raise possible corner cases and issues. I'll work on that. |
[system_tool_requires]
idea
if resolved is None: | ||
try: | ||
# TODO: If it is locked not resolve range | ||
# TODO: This range-resolve might resolve in a given remote or cache | ||
# Make sure next _resolve_recipe use it | ||
self._resolver.resolve(require, str(node.ref), self._remotes, self._update) | ||
resolved = self._resolve_recipe(require.ref, graph_lock) | ||
except ConanException as e: | ||
raise GraphError.missing(node, require, str(e)) |
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.
All this part doesnt change, just putting it inside the if resolved is 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.
Looks really nice, and as discussed, will help a ton
@@ -261,6 +261,12 @@ def get_profile(profile_text, base_profile=None): | |||
options = Options.loads(doc.options) if doc.options else None | |||
tool_requires = _ProfileValueParser._parse_tool_requires(doc) | |||
|
|||
if doc.system_tools: | |||
system_tools = [RecipeReference.loads(r.strip()) |
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.
For anyone wondering as I did if this could be improved, not until we support 3.8 with https://peps.python.org/pep-0572/ , which would let us write something like:
system_tools = [RecipeReference.loads(stripped) for r in doc.system_tools.splitlines() if (stripped := r.strip())]
[system_tool_requires]
idea[system_tools]
idea
Changelog: Feature: Add
[system_tools]
section to profiles to use your own installed tools instead of the packages declared in the requires.Very preliminary idea, just toying to see what could make sense