示例#1
0
 def download_packages(self, reference, package_ids):
     assert(isinstance(package_ids, list))
     remote, _ = self._get_remote(reference)
     export_path = self._client_cache.export(reference)
     self._remote_manager.get_recipe(reference, export_path, remote)
     conanfile_path = self._client_cache.conanfile(reference)
     loader = ConanFileLoader(None, None, None, None, None, None)
     conanfile = loader.load_class(conanfile_path)
     short_paths = conanfile.short_paths
     self._registry.set_ref(reference, remote)
     output = ScopedOutput(str(reference), self._out)
     for package_id in package_ids:
         package_ref = PackageReference(reference, package_id)
         package_folder = self._client_cache.package(package_ref, short_paths=short_paths)
         self._retrieve_remote_package(package_ref, package_folder, output, remote)
示例#2
0
文件: proxy.py 项目: conan-io/conan
 def download_packages(self, reference, package_ids):
     assert(isinstance(package_ids, list))
     remote, _ = self._get_remote(reference)
     export_path = self._client_cache.export(reference)
     self._remote_manager.get_recipe(reference, export_path, remote)
     conanfile_path = self._client_cache.conanfile(reference)
     loader = ConanFileLoader(None, None, None, None, None, None, None)
     conanfile = loader.load_class(conanfile_path)
     short_paths = conanfile.short_paths
     self._registry.set_ref(reference, remote)
     output = ScopedOutput(str(reference), self._out)
     for package_id in package_ids:
         package_reference = PackageReference(reference, package_id)
         package_folder = self._client_cache.package(package_reference, short_paths=short_paths)
         self._retrieve_remote_package(package_reference, package_folder, output, remote)
    def inherit_short_paths_test(self):
        loader = ConanFileLoader(None, TestBufferConanOutput(), ConanPythonRequire(None, None))
        tmp_dir = temp_folder()
        conanfile_path = os.path.join(tmp_dir, "conanfile.py")
        conanfile = """from base_recipe import BasePackage
class Pkg(BasePackage):
    pass
"""
        base_recipe = """from conans import ConanFile
class BasePackage(ConanFile):
    short_paths = True
"""
        save(conanfile_path, conanfile)
        save(os.path.join(tmp_dir, "base_recipe.py"), base_recipe)
        conan_file = loader.load_class(conanfile_path)
        self.assertEqual(conan_file.short_paths, True)

        result = loader.load_consumer(conanfile_path,
                                      processed_profile=test_processed_profile())
        self.assertEqual(result.short_paths, True)