Skip to content

Commit

Permalink
backport fix (#5849)
Browse files Browse the repository at this point in the history
  • Loading branch information
czoido committed Oct 1, 2019
1 parent 8f1c4e9 commit d7eb0c2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion conans/client/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 26 additions & 0 deletions conans/test/functional/python_requires/python_requires_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down

0 comments on commit d7eb0c2

Please sign in to comment.