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

Improve dependencies options changed in requirements() error msg #13668

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions conans/client/graph/compute_pid.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections import OrderedDict

from conans.errors import conanfile_exception_formatter, ConanInvalidConfiguration, \
conanfile_remove_attr
conanfile_remove_attr, ConanException
from conans.model.info import ConanInfo, RequirementsInfo, RequirementInfo, PythonRequiresInfo


Expand Down Expand Up @@ -39,9 +39,13 @@ def compute_package_id(node, new_config):
reqs_info = RequirementsInfo(data)
build_requires_info = RequirementsInfo(build_data)
python_requires = PythonRequiresInfo(python_requires, python_mode)
try:
copied_options = conanfile.options.copy_conaninfo_options()
except ConanException as e:
raise ConanException(f"{conanfile}: {e}")

conanfile.info = ConanInfo(settings=conanfile.settings.copy_conaninfo_settings(),
options=conanfile.options.copy_conaninfo_options(),
options=copied_options,
reqs_info=reqs_info,
build_requires_info=build_requires_info,
python_requires=python_requires,
Expand Down
2 changes: 1 addition & 1 deletion conans/test/integration/conanfile/conanfile_errors_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ def requirements(self):
""")
c.save({"conanfile.py": conanfile})
c.run("create .", assert_error=True)
assert "Dependencies options were defined incorrectly." in c.out
assert "ERROR: hello/0.1: Dependencies options were defined incorrectly." in c.out