Cache API

Warning

This feature is experimental and subject to breaking changes. See the Conan stability section for more information.

class CacheAPI(conan_api, api_helpers)

This CacheAPI is used to interact with the packages storage cache

check_integrity(package_list, return_pkg_list=False)

Check if the recipes and packages are corrupted

Parameters:
  • package_list – PackagesList to check

  • return_pkg_list – If True, return a PackagesList with corrupted artifacts

Returns:

PackagesList with corrupted artifacts if return_pkg_list is True

Raises:

ConanExcepcion if there are corrupted artifacts and return_pkg_list is False

clean(package_list, source=True, build=True, download=True, temp=True, backup_sources=False)

Remove non critical folders from the cache, like source, build and download (.tgz store) folders.

Parameters:
  • package_list – the package lists that should be cleaned

  • source – boolean, remove the “source” folder if True

  • build – boolean, remove the “build” folder if True

  • download – boolean, remove the “download (.tgz)” folder if True

  • temp – boolean, remove the temporary folders

  • backup_sources – boolean, remove the “source” folder if True

Returns:

get_backup_sources(package_list=None, exclude=True, only_upload=True)

Get list of backup source files currently present in the cache, either all of them if no argument, or filtered by those belonging to the references in the package_list

Parameters:
  • package_list – a PackagesList object to filter backup files from (The files should have been downloaded form any of the references in the package_list)

  • exclude – if True, exclude the sources that come from URLs present the core.sources:exclude_urls global conf

  • only_upload – if True, only return the files for packages that are set to be uploaded