rez.build_process

class rez.build_process.BuildProcess(working_dir, build_system, package=None, vcs=None, ensure_latest=True, skip_repo_errors=False, ignore_existing_tag=False, verbose=False, quiet=False)[source]

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.

build(install_path=None, clean=False, install=False, variants=None)[source]

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

get_changelog()[source]

Get the changelog since last package release.

Returns

Changelog.

Return type

str

classmethod name()[source]
property package
release(release_message=None, variants=None)[source]

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
class rez.build_process.BuildProcessHelper(working_dir, build_system, package=None, vcs=None, ensure_latest=True, skip_repo_errors=False, ignore_existing_tag=False, verbose=False, quiet=False)[source]

Bases: rez.build_process.BuildProcess

A BuildProcess base class with some useful functionality.

create_build_context(variant, build_type, build_path)[source]

Create a context to build the variant within.

get_changelog()[source]

Get the changelog since last package release.

Returns

Changelog.

Return type

str

get_current_tag_name()[source]
get_package_install_path(path)[source]

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

Parameters

path (str) – Package repository path.

get_previous_release()[source]
get_release_data()[source]

Get release data for this release.

Returns

dict.

post_release(release_message=None)[source]
pre_release()[source]
repo_operation()[source]
run_hooks(hook_event, **kwargs)[source]
visit_variants(func, variants=None, **kwargs)[source]

Iterate over variants and call a function on each.

class rez.build_process.BuildType(value, names=None, module=None, type=None)[source]

Bases: rez.vendor.enum.Enum

Enum to represent the type of build.

rez.build_process.create_build_process(process_type, working_dir, build_system, package=None, vcs=None, ensure_latest=True, skip_repo_errors=False, ignore_existing_tag=False, verbose=False, quiet=False)[source]

Create a BuildProcess instance.

rez.build_process.get_build_process_types()[source]

Returns the available build process implementations.