rez.build_process

rez.build_process.get_build_process_types()

Returns the available build process implementations.

rez.build_process.create_build_process(process_type: str, working_dir: str, build_system: BuildSystem, package=None, vcs: ReleaseVCS | None = None, ensure_latest: bool = True, skip_repo_errors: bool = False, ignore_existing_tag: bool = False, verbose: bool = False, quiet: bool = False) BuildProcess

Create a BuildProcess instance.

Warning

The working_dir argument and the pacakge keyword argument will are deprecated and will be removed in rez 3.0.0

class rez.build_process.BuildType

Bases: Enum

Enum to represent the type of build.

local = 0
central = 1
class rez.build_process.BuildProcess

Bases: object

A BuildProcess builds and possibly releases a package.

A build process iterates over the variants of a package, creates the correct build environment for each variant, builds that variant using a build system (or possibly creates a script so the user can do that independently), and then possibly releases the package with the nominated VCS. This is an abstract base class, you should use a BuildProcess subclass.

classmethod name()
__init__(working_dir: str, build_system: BuildSystem, package=None, vcs: ReleaseVCS | None = None, ensure_latest: bool = True, skip_repo_errors: bool = False, ignore_existing_tag: bool = False, verbose: bool = False, quiet: bool = False) None

Create a BuildProcess.

Parameters:
  • working_dir – Will be removed in rez 3.0.0 (DEPRECATED).

  • build_system (BuildSystem) – Build system used to build the package.

  • package – Will be removed in rez 3.0.0 (DEPRECATED).

  • vcs (ReleaseVCS) – Version control system to use for the release process.

  • ensure_latest – If True, do not allow the release process to occur if an newer versioned package is already released.

  • skip_repo_errors – If True, proceed with the release even when errors occur. BE CAREFUL using this option, it is here in case a package needs to be released urgently even though there is some problem with reading or writing the repository.

  • ignore_existing_tag – Perform the release even if the repository is already tagged at the current version. If the config setting plugins.release_vcs.check_tag is False, this has no effect.

  • verbose (bool) – Verbose mode.

  • quiet (bool) – Quiet mode (overrides verbose).

property package: DeveloperPackage
property working_dir: str
build(install_path: str | None = None, clean: bool = False, install: bool = False, variants: list[int] | None = None) int

Perform the build process.

Iterates over the package’s variants, resolves the environment for each, and runs the build system within each resolved environment.

Parameters:
  • install_path (str) – The package repository path to install the package to, if installing. If None, defaults to config.local_packages_path.

  • clean (bool) – If True, clear any previous build first. Otherwise, rebuild over the top of a previous build.

  • install (bool) – If True, install the build.

  • variants (list of int) – Indexes of variants to build, all if None.

Raises:

BuildError – If the build failed.

Returns:

Number of variants successfully built.

Return type:

int

release(release_message: str | None = None, variants: list[int] | None = None) int

Perform the release process.

Iterates over the package’s variants, building and installing each into the release path determined by config.release_packages_path.

Parameters:
  • release_message (str) – Message to associate with the release.

  • variants (list of int) – Indexes of variants to release, all if None.

Raises:

ReleaseError – If the release failed.

Returns:

Number of variants successfully released.

Return type:

int

get_changelog() str | None

Get the changelog since last package release.

Returns:

Changelog.

Return type:

str

class rez.build_process.BuildProcessHelper

Bases: BuildProcess

A BuildProcess base class with some useful functionality.

repo_operation()
visit_variants(func, variants: list[int] | None = None, **kwargs) tuple[int, list[str | None]]

Iterate over variants and call a function on each.

get_package_install_path(path: str) str

Return the installation path for a package (where its payload goes).

Parameters:

path (str) – Package repository path.

create_build_context(variant: Variant, build_type: BuildType, build_path: str) tuple[ResolvedContext, str]

Create a context to build the variant within.

pre_release() None
post_release(release_message=None) None
get_current_tag_name() str
run_hooks(hook_event, **kwargs) None
get_previous_release() Package | None
get_changelog() str | None

Get the changelog since last package release.

Returns:

Changelog.

Return type:

str

get_release_data()

Get release data for this release.

Returns:

dict.

__init__(working_dir: str, build_system: BuildSystem, package=None, vcs: ReleaseVCS | None = None, ensure_latest: bool = True, skip_repo_errors: bool = False, ignore_existing_tag: bool = False, verbose: bool = False, quiet: bool = False) None

Create a BuildProcess.

Parameters:
  • working_dir – Will be removed in rez 3.0.0 (DEPRECATED).

  • build_system (BuildSystem) – Build system used to build the package.

  • package – Will be removed in rez 3.0.0 (DEPRECATED).

  • vcs (ReleaseVCS) – Version control system to use for the release process.

  • ensure_latest – If True, do not allow the release process to occur if an newer versioned package is already released.

  • skip_repo_errors – If True, proceed with the release even when errors occur. BE CAREFUL using this option, it is here in case a package needs to be released urgently even though there is some problem with reading or writing the repository.

  • ignore_existing_tag – Perform the release even if the repository is already tagged at the current version. If the config setting plugins.release_vcs.check_tag is False, this has no effect.

  • verbose (bool) – Verbose mode.

  • quiet (bool) – Quiet mode (overrides verbose).

build(install_path: str | None = None, clean: bool = False, install: bool = False, variants: list[int] | None = None) int

Perform the build process.

Iterates over the package’s variants, resolves the environment for each, and runs the build system within each resolved environment.

Parameters:
  • install_path (str) – The package repository path to install the package to, if installing. If None, defaults to config.local_packages_path.

  • clean (bool) – If True, clear any previous build first. Otherwise, rebuild over the top of a previous build.

  • install (bool) – If True, install the build.

  • variants (list of int) – Indexes of variants to build, all if None.

Raises:

BuildError – If the build failed.

Returns:

Number of variants successfully built.

Return type:

int

classmethod name()
property package: DeveloperPackage
release(release_message: str | None = None, variants: list[int] | None = None) int

Perform the release process.

Iterates over the package’s variants, building and installing each into the release path determined by config.release_packages_path.

Parameters:
  • release_message (str) – Message to associate with the release.

  • variants (list of int) – Indexes of variants to release, all if None.

Raises:

ReleaseError – If the release failed.

Returns:

Number of variants successfully released.

Return type:

int

property working_dir: str