diff --git a/conans/client/installer.py b/conans/client/installer.py index 1bd24f6aab7..dac9c92a717 100644 --- a/conans/client/installer.py +++ b/conans/client/installer.py @@ -427,7 +427,7 @@ def _build_package(self, node, output, keep_build, remotes): assert python_require.ref.revision is not None, \ "Installer should receive python_require.ref always" complete_recipe_sources(self._remote_manager, self._cache, - conanfile, python_require.ref, remotes) + python_require.conanfile, python_require.ref, remotes) builder = _PackageBuilder(self._cache, output, self._hook_manager, self._remote_manager) pref = builder.build_package(node, keep_build, self._recorder, remotes) diff --git a/conans/test/functional/python_requires/python_requires_test.py b/conans/test/functional/python_requires/python_requires_test.py index aa238d65553..65a85fce683 100644 --- a/conans/test/functional/python_requires/python_requires_test.py +++ b/conans/test/functional/python_requires/python_requires_test.py @@ -576,6 +576,32 @@ class Lib(ConanFile): self.assertIn("Same python_requires with different versions not allowed for a conanfile", t.out) + def short_paths_test(self): + # https://github.com/conan-io/conan/issues/5814 + client = TestClient(default_server_user=True) + conanfile = textwrap.dedent(""" + from conans import ConanFile + class MyConanfileBase(ConanFile): + exports = "*.txt" + exports_sources = "*.h" + """) + client.save({"conanfile.py": conanfile, + "file.h": "header", + "other.txt": "text"}) + client.run("create . Base/1.2@lasote/testing") + + reuse = textwrap.dedent(""" + from conans import python_requires + base = python_requires("Base/1.2@lasote/testing") + class PkgTest(base.MyConanfileBase): + short_paths = True + name = "consumer" + version = "1.0.0" + """) + client.save({"conanfile.py": reuse}, clean_first=True) + client.run("create . lasote/testing") + self.assertIn("consumer/1.0.0@lasote/testing: Created package revision", client.out) + class PythonRequiresNestedTest(unittest.TestCase):