Skip to content
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
2 changes: 1 addition & 1 deletion conans/client/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def _build_package(self, node, pref, output, keep_build, remotes):
assert pref.id, "Package-ID without value"

# It is necessary to complete the sources of python requires, which might be used
for name, python_require in conanfile.python_requires.items():
for python_require in conanfile.python_requires.values():
assert python_require.ref.revision is not None, \
"Installer should receive python_require.ref always"
complete_recipe_sources(self._remote_manager, self._cache,
Expand Down
2 changes: 1 addition & 1 deletion conans/client/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def install(self, ref_or_path, install_folder, graph_info, remotes=None, build_m
installer = BinaryInstaller(self._cache, self._user_io.out, self._remote_manager,
recorder=self._recorder,
hook_manager=self._hook_manager)
installer.install(deps_graph, remotes, keep_build=keep_build)
installer.install(deps_graph, remotes, keep_build=keep_build, graph_info=graph_info)

if manifest_folder:
manifest_manager = ManifestManager(manifest_folder, user_io=self._user_io,
Expand Down
22 changes: 21 additions & 1 deletion conans/test/functional/editable/layouts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,32 @@
import unittest

from conans.model.editable_layout import LAYOUTS_FOLDER
from conans.model.ref import ConanFileReference
from conans.test.utils.conanfile import TestConanFile
from conans.test.utils.test_files import temp_folder
from conans.test.utils.tools import TestClient
from conans.util.files import load, save_files, save


class LayoutTest(unittest.TestCase):

def test_editable_crash(self):
ref = ConanFileReference.loads("lib/1.0@conan/stable")
client = TestClient()
layout = textwrap.dedent("""
[build_folder]
build
""")
client.save({"conanfile.py": TestConanFile("lib", "1.0"),
"mylayout": layout})
client.run("editable add . {} --layout mylayout".format(ref))
client2 = TestClient(base_folder=client.base_folder)
client2.save({"conanfile.py": TestConanFile("app", "1.0",
requires=["lib/1.0@conan/stable"])})
client2.run("create . user/testing")
graph_info = os.path.join(client.current_folder, "build", "graph_info.json")
self.assertTrue(os.path.exists(graph_info))

def test_missing_wrong_layouts(self):
client = TestClient()
conanfile = textwrap.dedent("""
Expand Down Expand Up @@ -202,7 +221,8 @@ class Pkg(ConanFile):
client2.run("install . -g cmake -s build_type=Debug", assert_error=True)
self.assertIn("ERROR: Error parsing layout file '{}' (for reference "
"'mytool/0.1@user/testing')\n'settings.build_type' doesn't exist".format(
os.path.join(client.current_folder, 'layout')), client2.out)
os.path.join(client.current_folder, 'layout')),
client2.out)

# Now add settings to conanfile
client.save({"conanfile.py": conanfile.replace("pass", 'settings = "build_type"')})
Expand Down
3 changes: 2 additions & 1 deletion conans/test/utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ def run(self, command_line, user_io=None, assert_error=False):

def run_command(self, command):
self.all_output += str(self.out)
self.init_dynamic_vars() # Resets the output
self.init_dynamic_vars() # Resets the output
return self.runner(command, cwd=self.current_folder)

def save(self, files, path=None, clean_first=False):
Expand All @@ -858,6 +858,7 @@ def save(self, files, path=None, clean_first=False):
path = path or self.current_folder
if clean_first:
shutil.rmtree(self.current_folder, ignore_errors=True)
files = {f: str(content) for f, content in files.items()}
save_files(path, files)
if not files:
mkdir(self.current_folder)
Expand Down