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][poc] Checking the [system_tools] idea #10166

Merged
merged 14 commits into from
Feb 15, 2023

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Dec 13, 2021

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

@memsharded memsharded changed the title playing with the deferred idea [develop2][poc] Checking the deferred to system idea Dec 13, 2021
@memsharded memsharded requested a review from lasote December 20, 2021 11:34
@memsharded memsharded requested a review from czoido December 21, 2021 11:44
Copy link
Contributor

@lasote lasote left a 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.

@memsharded
Copy link
Member Author

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.

@memsharded memsharded added this to the 2.0.0-alpha3 milestone Dec 28, 2021
@memsharded memsharded changed the title [develop2][poc] Checking the deferred to system idea [develop2][poc] Checking the [system_tool_requires] idea Feb 3, 2023
Comment on lines +235 to +243
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))
Copy link
Member Author

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

@memsharded memsharded requested review from jcar87 and AbrilRBS February 3, 2023 01:19
@memsharded memsharded requested a review from uilianries February 3, 2023 08:57
@memsharded memsharded marked this pull request as ready for review February 3, 2023 12:33
Copy link
Member

@AbrilRBS AbrilRBS left a 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())
Copy link
Member

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())]

@memsharded memsharded merged commit ea67674 into conan-io:develop2 Feb 15, 2023
@memsharded memsharded deleted the feature/develop2_deferred branch February 15, 2023 08:53
@franramirez688 franramirez688 changed the title [develop2][poc] Checking the [system_tool_requires] idea [develop2][poc] Checking the [system_tools] idea Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants