rez.package_resources#

rez.package_resources.late_bound(schema)#
class rez.package_resources.PackageRepositoryResource#

Bases: Resource

Base class for all package-related resources.

schema_error#

alias of PackageMetadataError

repository_type = None#

Type of package repository associated with this resource type.

classmethod normalize_variables(variables)#

Give subclasses a chance to standardize values for certain variables

__init__(variables=None)#
uri()#
property location#
property name#
get(key, default=None)#

Get the value of a resource variable.

handle()#

Get the resource handle.

key = None#

Unique identifier of the resource type.

schema = None#

Schema for the resource data. Must validate a dict. Can be None, in which case the resource does not load any data.

class rez.package_resources.PackageFamilyResource#

Bases: PackageRepositoryResource

A package family.

A repository implementation’s package family resource(s) must derive from this class. It must satisfy the schema package_family_schema.

__init__(variables=None)#
get(key, default=None)#

Get the value of a resource variable.

handle()#

Get the resource handle.

key = None#

Unique identifier of the resource type.

property location#
property name#
classmethod normalize_variables(variables)#

Give subclasses a chance to standardize values for certain variables

repository_type = None#

Type of package repository associated with this resource type.

schema = None#

Schema for the resource data. Must validate a dict. Can be None, in which case the resource does not load any data.

schema_error#

alias of PackageMetadataError

uri()#
class rez.package_resources.PackageResource#

Bases: PackageRepositoryResource

A package.

A repository implementation’s package resource(s) must derive from this class. It must satisfy the schema package_schema.

classmethod normalize_variables(variables)#

Make sure version is treated consistently

version()#
__init__(variables=None)#
get(key, default=None)#

Get the value of a resource variable.

handle()#

Get the resource handle.

key = None#

Unique identifier of the resource type.

property location#
property name#
repository_type = None#

Type of package repository associated with this resource type.

schema = None#

Schema for the resource data. Must validate a dict. Can be None, in which case the resource does not load any data.

schema_error#

alias of PackageMetadataError

uri()#
class rez.package_resources.VariantResource#

Bases: PackageResource

A package variant.

A repository implementation’s variant resource(s) must derive from this class. It must satisfy the schema variant_schema.

Even packages that do not have a ‘variants’ section contain a variant - in this case it is the ‘None’ variant (the value of index is None). This provides some internal consistency and simplifies the implementation.

property index#
root()#

Return the ‘root’ path of the variant.

subpath()#

Return the variant’s ‘subpath’

The subpath is the relative path the variant’s payload should be stored under, relative to the package base. If None, implies that the variant root matches the package base.

__init__(variables=None)#
get(key, default=None)#

Get the value of a resource variable.

handle()#

Get the resource handle.

key = None#

Unique identifier of the resource type.

property location#
property name#
classmethod normalize_variables(variables)#

Make sure version is treated consistently

repository_type = None#

Type of package repository associated with this resource type.

schema = None#

Schema for the resource data. Must validate a dict. Can be None, in which case the resource does not load any data.

schema_error#

alias of PackageMetadataError

uri()#
version()#
class rez.package_resources.PackageResourceHelper#

Bases: PackageResource

PackageResource with some common functionality included.

variant_key = None#
commands()#
pre_commands()#
post_commands()#
iter_variants()#
__init__(variables=None)#
get(key, default=None)#

Get the value of a resource variable.

handle()#

Get the resource handle.

key = None#

Unique identifier of the resource type.

property location#
property name#
classmethod normalize_variables(variables)#

Make sure version is treated consistently

repository_type = None#

Type of package repository associated with this resource type.

schema = None#

Schema for the resource data. Must validate a dict. Can be None, in which case the resource does not load any data.

schema_error#

alias of PackageMetadataError

uri()#
version()#
class rez.package_resources.VariantResourceHelper#

Bases: VariantResource

Helper class for implementing variants that inherit properties from their parent package.

Since a variant overlaps so much with a package, here we use the forwarding metaclass to forward our parent package’s attributes onto ourself (with some exceptions - eg ‘variants’, ‘requires’). This is a common enough pattern that it’s supplied here for other repository plugins to use.

schema = Schema({Schema('name'): <class 'str'>, Optional('base'): <class 'str'>, Optional('version'): <class 'rez.version._version.Version'>, Optional('description'): <class 'str'>, Optional('authors'): [<class 'str'>], Optional('requires'): Or(<class 'rez.utils.sourcecode.SourceCode'>, [<class 'rez.utils.formatting.PackageRequest'>]), Optional('build_requires'): Or(<class 'rez.utils.sourcecode.SourceCode'>, [<class 'rez.utils.formatting.PackageRequest'>]), Optional('private_build_requires'): Or(<class 'rez.utils.sourcecode.SourceCode'>, [<class 'rez.utils.formatting.PackageRequest'>]), Optional('has_plugins'): Or(<class 'rez.utils.sourcecode.SourceCode'>, <class 'bool'>), Optional('plugin_for'): Or(<class 'rez.utils.sourcecode.SourceCode'>, [<class 'str'>]), Optional('uuid'): <class 'str'>, Optional('config'): <class 'rez.config.Config'>, Optional('tools'): Or(<class 'rez.utils.sourcecode.SourceCode'>, [<class 'str'>]), Optional('help'): Or(<class 'rez.utils.sourcecode.SourceCode'>, Or(<class 'str'>, [[<class 'str'>]])), Optional('hashed_variants'): <class 'bool'>, Optional('relocatable'): Or(<class 'rez.utils.sourcecode.SourceCode'>, Or(None, <class 'bool'>)), Optional('cachable'): Or(<class 'rez.utils.sourcecode.SourceCode'>, Or(None, <class 'bool'>)), Optional('tests'): Or(<class 'rez.utils.sourcecode.SourceCode'>, Schema({Optional(<class 'str'>): Or(Or(<class 'str'>, [<class 'str'>]), {Optional(<class 'str'>): <class 'object'>, 'command': Or(<class 'str'>, [<class 'str'>]), Optional('requires'): [Or(<class 'rez.utils.formatting.PackageRequest'>, And(<class 'str'>, Use(<class 'rez.utils.formatting.PackageRequest'>)))], Optional('run_on'): Or(<class 'str'>, [<class 'str'>]), Optional('on_variants'): Or(<class 'bool'>, {'type': 'requires', 'value': [Or(<class 'rez.utils.formatting.PackageRequest'>, And(<class 'str'>, Use(<class 'rez.utils.formatting.PackageRequest'>)))]})})})), Optional('pre_commands'): <class 'rez.utils.sourcecode.SourceCode'>, Optional('commands'): <class 'rez.utils.sourcecode.SourceCode'>, Optional('post_commands'): <class 'rez.utils.sourcecode.SourceCode'>, Optional('pre_build_commands'): <class 'rez.utils.sourcecode.SourceCode'>, Optional('pre_test_commands'): <class 'rez.utils.sourcecode.SourceCode'>, Optional('timestamp'): <class 'int'>, Optional('revision'): <class 'object'>, Optional('changelog'): <class 'str'>, Optional('release_message'): Or(None, <class 'str'>), Optional('previous_version'): <class 'rez.version._version.Version'>, Optional('previous_revision'): <class 'object'>, Optional('vcs'): <class 'str'>, Optional(<class 'str'>): Or(<class 'rez.utils.sourcecode.SourceCode'>, <class 'object'>)})#

Schema for the resource data. Must validate a dict. Can be None, in which case the resource does not load any data.

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', 'vcs', 'version'}#
variant_requires()#
property wrapped#
__init__(variables=None)#
property authors#
property base#
property build_requires#
property cachable#
property changelog#
property commands#
property config#
property description#
get(key, default=None)#

Get the value of a resource variable.

handle()#

Get the resource handle.

property has_plugins#
property hashed_variants#
property help#
property index#
key = None#

Unique identifier of the resource type.

property location#
property name#
classmethod normalize_variables(variables)#

Make sure version is treated consistently

property plugin_for#
property post_commands#
property pre_build_commands#
property pre_commands#
property pre_test_commands#
property previous_revision#
property previous_version#
property private_build_requires#
property release_message#
property relocatable#
repository_type = None#

Type of package repository associated with this resource type.

property requires#
property revision#
root()#

Return the ‘root’ path of the variant.

schema_error#

alias of PackageMetadataError

subpath()#

Return the variant’s ‘subpath’

The subpath is the relative path the variant’s payload should be stored under, relative to the package base. If None, implies that the variant root matches the package base.

property tests#
property timestamp#
property tools#
uri()#
property uuid#
validate_data()#
validated_data()#
property vcs#
version()#