rez.package_remove#

rez.package_remove.remove_package_family(name, path, force=False)#

Remove a package family from its repository.

A family can only be deleted if it contains no packages, hidden or otherwise, unless force is True.

Parameters:
  • name (str) – Name of package family.

  • path (str) – Package repository path containing the package family.

  • force (bool) – If True, delete family even if not empty.

Returns:

True if the package family was removed, False if not found.

Return type:

bool

rez.package_remove.remove_package(name, version, path)#

Remove a package from its repository.

Note that you are able to remove a package that is hidden (ie ignored). This is why a Package instance is not specified (if the package were hidden, you wouldn’t be able to get one).

Parameters:
  • name (str) – Name of package.

  • version (Version or str) – Version of the package, eg ‘1.0.0’

  • path (str) – Package repository path containing the package.

Returns:

True if the package was removed, False if package not found.

Return type:

bool

rez.package_remove.remove_packages_ignored_since(days, paths=None, dry_run=False, verbose=False)#

Remove packages ignored for >= specified number of days.

Parameters:
  • days (int) – Remove packages ignored >= this many days

  • paths (Optional[list[str]]) – Paths to search for packages, defaults to config.packages_path.

  • dry_run – Dry run mode

  • verbose (bool) – Verbose mode

Returns:

Number of packages removed. In dry-run mode, returns the number of packages that _would_ be removed.

Return type:

int