From 26fd0ddb74a763ef4143ffe10809731391fbb171 Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Tue, 1 Oct 2019 10:51:21 +0200 Subject: [PATCH] Issue/5814 fix python_requires with short_paths enabled (#5841) * Added required = True to subparsers in order to print error message in Py2 and Py3. * sync * basic concurrent upload at reference level with futures * revert changes * add line * Lock buggy urllib3 (#5808) * app simplifying (#5806) * Apply lockfile before updating downstream requires (#5771) * apply graph_lock before looking for overrides * first step: get rid of the warning * cleaner if graph_lock is passed to the function * only update requires upstream if no lockfile is applied * fix tests * Deprecation of CONAN_USERNAME and CONAN_CHANNEL: fix error message (#5756) * if CONAN_USERNAME and CONAN_CHANNEL are deprecated, the error cannot recommend them * update tests accordingly * test client load() file method (#5815) * no user/channel repr without _ (#5817) * no user/channel repr without _ * minor fixes * fix tests * Remove py34 (#5820) * fix upload package id (#5824) * - update macOS, watchOS, tvOS, iOS version numbers (#5823) * Refresh token client support. (#5662) * Refresh token client support. Missing tests. Missing migration * public method * WIP * Refresh almost there * Removed prints * Try migrate * Migration * Add comment * Refresh token flow following RFC recommentations * Refresh ok * review * Remove traces * Refactor capabilities * Removed tmp file * Review * #5819 Show warning message for Python 3.4 (#5829) * #5819 Show warning message for Python 3.4 - Add new warning message for python 3.4 which is no longer supported - Added funcional tests to validate both python 3.4 and 2.x Signed-off-by: Uilian Ries * #5819 Fix broken tests Signed-off-by: Uilian Ries * Add cpp_info.name to cmake and pkg_config generators (#5598) * Add cpp_info.name to cmake generators * Fix unit tests to mimic real behavior * cmake_paths test * add test for cmake generator * Add cmake_find_package test * fix test in py3 * Applied cpp_info.name to pkg_config generator * check different name in pkg_config * use pyreq short path if exists * sync with develop * revert change * pass correct conanfile * add test * remove line * clean test --- conans/client/installer.py | 2 +- .../python_requires/python_requires_test.py | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) 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):