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

Explore improved error message for missing component requirements #17319

Draft
wants to merge 3 commits into
base: develop2
Choose a base branch
from

Conversation

AbrilRBS
Copy link
Member

Changelog: (Feature | Fix | Bugfix): Describe here your pull request
Docs: https://github.com/conan-io/docs/pull/XXXX

The idea is to have the faulty component be reported too, for cases where finding it is a bit hard, see #17312 for example.

# Then split the names
ret = [r.split("::") if "::" in r else (None, r) for r in ret]
ret = [(*r[0].split("::"), r[1]) if "::" in r[0] else (None, *r) for r in ret]
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the main change - required_components now returns a 3-tuple. This is a draft because as far as I can see, this might be breaking behaviour as this function is public, so not too sure on the best approach.

Also note that as far as I can tell, the unpacking operator * was implemented in Python 3.5 so we're good to use it

Copy link
Member

Choose a reason for hiding this comment

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

Public, but not documented apparently.
Still, it reads a bit risky, yes, not fully sure if worth the risk. Maybe a different approach like re-computing things when the check fails for better error messages (making it exclusively local to the error handling)?

test/integration/test_components_error.py Show resolved Hide resolved
# Then split the names
ret = [r.split("::") if "::" in r else (None, r) for r in ret]
ret = [(*r[0].split("::"), r[1]) if "::" in r[0] else (None, *r) for r in ret]
Copy link
Member

Choose a reason for hiding this comment

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

Public, but not documented apparently.
Still, it reads a bit risky, yes, not fully sure if worth the risk. Maybe a different approach like re-computing things when the check fails for better error messages (making it exclusively local to the error handling)?

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.

2 participants