Skip to content

Commit

Permalink
Improve dependencies options changed in requirements() error msg (#13668
Browse files Browse the repository at this point in the history
)
  • Loading branch information
memsharded authored Apr 11, 2023
1 parent 1bcd553 commit 1e33e0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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

0 comments on commit 1e33e0e

Please sign in to comment.