|
8 | 8 | from conan.api.output import ConanOutput |
9 | 9 | from conan.internal.api.uploader import compress_files |
10 | 10 | from conan.internal.cache.cache import PkgCache |
11 | | -from conan.internal.cache.conan_reference_layout import EXPORT_SRC_FOLDER, EXPORT_FOLDER, SRC_FOLDER, \ |
12 | | - METADATA, DOWNLOAD_EXPORT_FOLDER |
| 11 | +from conan.internal.cache.conan_reference_layout import (EXPORT_SRC_FOLDER, EXPORT_FOLDER, |
| 12 | + SRC_FOLDER, METADATA, |
| 13 | + DOWNLOAD_EXPORT_FOLDER) |
13 | 14 | from conan.internal.cache.home_paths import HomePaths |
14 | 15 | from conan.internal.cache.integrity_check import IntegrityChecker |
15 | 16 | from conan.internal.rest.download_cache import DownloadCache |
@@ -104,7 +105,8 @@ def clean(self, package_list, source=True, build=True, download=True, temp=True, |
104 | 105 | if not os.path.exists(manifest) or not os.path.exists(info): |
105 | 106 | rmdir(folder) |
106 | 107 | if backup_sources: |
107 | | - backup_files = self._conan_api.cache.get_backup_sources(package_list, exclude=False, only_upload=False) |
| 108 | + backup_files = self._conan_api.cache.get_backup_sources(package_list, exclude=False, |
| 109 | + only_upload=False) |
108 | 110 | ConanOutput().verbose(f"Cleaning {len(backup_files)} backup sources") |
109 | 111 | for f in backup_files: |
110 | 112 | remove(f) |
@@ -175,7 +177,8 @@ def save(self, package_list, tgz_path, no_source=False): |
175 | 177 | pkglist_path = os.path.join(tempfile.gettempdir(), "pkglist.json") |
176 | 178 | save(pkglist_path, serialized) |
177 | 179 | tar_files["pkglist.json"] = pkglist_path |
178 | | - compress_files(tar_files, os.path.basename(tgz_path), os.path.dirname(tgz_path), compresslevel, recursive=True) |
| 180 | + compress_files(tar_files, os.path.basename(tgz_path), os.path.dirname(tgz_path), |
| 181 | + compresslevel, recursive=True) |
179 | 182 | remove(pkglist_path) |
180 | 183 |
|
181 | 184 | def restore(self, path): |
@@ -260,7 +263,8 @@ def get_backup_sources(self, package_list=None, exclude=True, only_upload=True): |
260 | 263 | download_cache_path = config.get("core.sources:download_cache") |
261 | 264 | download_cache_path = download_cache_path or HomePaths( |
262 | 265 | self._conan_api.cache_folder).default_sources_backup_folder |
263 | | - excluded_urls = config.get("core.sources:exclude_urls", check_type=list, default=[]) if exclude else [] |
| 266 | + excluded_urls = config.get("core.sources:exclude_urls", |
| 267 | + check_type=list, default=[]) if exclude else [] |
264 | 268 | download_cache = DownloadCache(download_cache_path) |
265 | 269 | return download_cache.get_backup_sources_files(excluded_urls, package_list, only_upload) |
266 | 270 |
|
|
0 commit comments