rez.developer_package

class rez.developer_package.PreprocessMode

Bases: Enum

Defines when a package preprocess will be executed.

before = 0
after = 1
override = 2
class rez.developer_package.DeveloperPackage

Bases: Package

A developer package.

This is a package in a source directory that is subsequently built or released.

__init__(resource)
property root
classmethod from_path(path, format=None)

Load a developer package.

A developer package may for example be a package.yaml or package.py in a user’s source directory.

Parameters:
  • path – Directory containing the package definition file, or file path for the package file itself

  • format – which FileFormat to use, or None to check both .py and .yaml

Returns:

Package object.

get_reevaluated(objects)

Get a newly loaded and re-evaluated package.

Values in objects are made available to early-bound package attributes. For example, a re-evaluated package might return a different value for an early-bound ‘private_build_requires’, depending on the variant currently being built.

Parameters:

objects (dict) – Variables to expose to early-bound package attribs.

Returns:

New package.

Return type:

DeveloperPackage

arbitrary_keys()

Get the arbitrary keys present in this package.

These are any keys not in the standard list (‘name’, ‘version’ etc).

Returns:

Arbitrary keys.

Return type:

set of str

as_exact_requirement()

Get the package, as an exact requirement string.

Returns:

Equivalent requirement string, eg “maya==2016.1”

property authors
property base
property build_requires
property cachable
property changelog
property commands
property config

Returns the config for this package.

Defaults to global config if this package did not provide a ‘config’ section.

property data
property description
format(s, pretty=None, expand=None)

Format a string.

Parameters:
  • s (str) – String to format, eg “hello {name}”

  • pretty (bool) – If True, references to non-string attributes such as lists are converted to basic form, with characters such as brackets and parenthesis removed. If None, defaults to the object’s ‘format_pretty’ attribute.

  • expand (StringFormatType) – Expansion mode. If None, will default to the object’s ‘format_expand’ attribute.

Returns:

The formatting string.

format_expand = 3
format_pretty = True
get_variant(index=None)

Get the variant with the associated index.

Returns:

Variant object, or None if no variant with the given index exists.

property handle
property has_plugins
property hashed_variants
property help
property is_cachable

True if the package and its payload is safe to cache locally.

is_local()

Returns True if the package is in the local package repository

is_package = True

Allows for a simple check like this.is_package in late-bound funcs, where this may be a package or variant.

property is_relocatable

True if the package and its payload is safe to copy.

is_variant = False

Allows for a simple check like this.is_variant in late-bound funcs, where this may be a package or variant.

iter_variants()

Iterate over the variants within this package, in index order.

Returns:

Variant iterator.

keys = {'authors', 'base', 'build_requires', 'cachable', 'changelog', 'commands', 'config', 'description', 'has_plugins', 'hashed_variants', 'help', 'name', 'plugin_for', 'post_commands', 'pre_build_commands', 'pre_commands', 'pre_test_commands', 'previous_revision', 'previous_version', 'private_build_requires', 'release_message', 'relocatable', 'requires', 'revision', 'tests', 'timestamp', 'tools', 'uuid', 'variants', 'vcs', 'version'}
late_bind_schemas = {'requires': Schema([Or(<class 'rez.utils.formatting.PackageRequest'>, And(<class 'str'>, Use(<class 'rez.utils.formatting.PackageRequest'>)))])}
property name
num_variants()
parent()

Get the parent package family.

Returns:

PackageFamily.

property plugin_for
property post_commands
property pre_build_commands
property pre_commands
property pre_test_commands
property previous_revision
property previous_version
print_info(buf=None, format_=FileFormat.yaml, skip_attributes=None, include_release=False)

Print the contents of the package.

Parameters:
  • buf (IO) – Stream to write to.

  • format (FileFormat) – Format to write in.

  • skip_attributes (list of str) – List of attributes to not print.

  • include_release (bool) – If True, include release-related attributes, such as ‘timestamp’ and ‘changelog’

property private_build_requires
qualified_name()

Get the qualified name of the package.

Returns:

Name of the package with version, eg “maya-2016.1”.

Return type:

str

property release_message
property relocatable
property repository

The package repository this resource comes from.

Returns:

PackageRepository.

property requires
property resource
property revision
set_context(context)
property tests
property timestamp
property tools
property uri
property uuid
validate_data()
validated_data()
property variants
property vcs
property version