rezplugins.package_repository.memory

In-memory package repository

class rezplugins.package_repository.memory.MemoryPackageFamilyResource(variables=None)[source]

Bases: rez.package_resources.PackageFamilyResource

iter_packages()[source]
key = 'memory.family'
repository_type = 'memory'
class rezplugins.package_repository.memory.MemoryPackageRepository(location, resource_pool)[source]

Bases: rez.package_repository.PackageRepository

An in-memory package repository.

Packages are stored in a dict, organised like so:

{
“foo”: {
“1.0.0”: {

“name”: “foo”, “version”: “1.0.0”, “description”: “does foo-like things.”,

}

},

“bah”: {
“_NO_VERSION”: {

“name”: “bah”, “description”: “does bah-like things.”, “requires”: [“python-2.6”, “foo-1+”]

}

}

}

This example repository contains one versioned package ‘foo’, and one unversioned package ‘bah’.

classmethod create_repository(repository_data)[source]

Create a standalone, in-memory repository.

Using this function bypasses the package_repository_manager singleton. This is usually desired however, since in-memory repositories are for temporarily storing programmatically created packages, which we do not want to cache and that do not persist.

Parameters

repository_data (dict) – Repository data, see class docstring.

Returns

MemoryPackageRepository object.

get_package_family(name)[source]

Get a package family.

Parameters

name (str) – Package name.

Returns

PackageFamilyResource, or None if not found.

get_parent_package(variant_resource)[source]

Get the parent package of the given variant.

Parameters

variant_resource (VariantResource) – Variant.

Returns

PackageResource.

get_parent_package_family(package_resource)[source]

Get the parent package family of the given package.

Parameters

package_resource (PackageResource) – Package.

Returns

PackageFamilyResource.

iter_package_families()[source]

Iterate over the package families in the repository, in no particular order.

Returns

PackageFamilyResource iterator.

iter_packages(package_family_resource)[source]

Iterate over the packages within the given family, in no particular order.

Parameters

package_family_resource (PackageFamilyResource) – Parent family.

Returns

PackageResource iterator.

iter_variants(package_resource)[source]

Iterate over the variants within the given package.

Parameters

package_resource (PackageResource) – Parent package.

Returns

VariantResource iterator.

classmethod name()[source]

Return the name of the package repository type.

class rezplugins.package_repository.memory.MemoryPackageResource(variables=None)[source]

Bases: rez.package_resources.PackageResourceHelper

authors

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
property base
build_requires

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
cachable

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
changelog

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
config

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
description

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
has_plugins

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
hashed_variants

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
help

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
key = 'memory.package'
parent

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
plugin_for

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
pre_build_commands

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
pre_test_commands

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
previous_revision

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
previous_version

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
private_build_requires

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
release_message

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
relocatable

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
repository_type = 'memory'
requires

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
revision

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
schema = Schema({Schema('name'): <class 'str'>, Optional('base'): <class 'str'>, Optional('version'): And(<class 'str'>, Use(<class 'rez.vendor.version.version.Version'>)), Optional('description'): And(<class 'str'>, Use(<function <lambda>>)), Optional('authors'): [<class 'str'>], Optional('requires'): Or(<class 'rez.utils.sourcecode.SourceCode'>, [And(<class 'str'>, Use(<class 'rez.utils.formatting.PackageRequest'>))]), Optional('build_requires'): Or(<class 'rez.utils.sourcecode.SourceCode'>, [And(<class 'str'>, Use(<class 'rez.utils.formatting.PackageRequest'>))]), Optional('private_build_requires'): Or(<class 'rez.utils.sourcecode.SourceCode'>, [And(<class 'str'>, Use(<class 'rez.utils.formatting.PackageRequest'>))]), Optional('variants'): [[And(<class 'str'>, Use(<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'): And(<class 'dict'>, Use(<function <lambda>>)), 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'): Or(<class 'rez.utils.sourcecode.SourceCode'>, <built-in function callable>, <class 'str'>, [<class 'str'>]), Optional('commands'): Or(<class 'rez.utils.sourcecode.SourceCode'>, <built-in function callable>, <class 'str'>, [<class 'str'>]), Optional('post_commands'): Or(<class 'rez.utils.sourcecode.SourceCode'>, <built-in function callable>, <class 'str'>, [<class 'str'>]), Optional('pre_build_commands'): Or(<class 'rez.utils.sourcecode.SourceCode'>, <built-in function callable>, <class 'str'>, [<class 'str'>]), Optional('pre_test_commands'): Or(<class 'rez.utils.sourcecode.SourceCode'>, <built-in function callable>, <class 'str'>, [<class 'str'>]), Optional('timestamp'): <class 'int'>, Optional('revision'): <class 'object'>, Optional('changelog'): And(<class 'str'>, Use(<function <lambda>>)), Optional('release_message'): Or(None, <class 'str'>), Optional('previous_version'): And(<class 'str'>, Use(<class 'rez.vendor.version.version.Version'>)), Optional('previous_revision'): <class 'object'>, Optional('vcs'): <class 'str'>, Optional(<class 'str'>): Or(<class 'rez.utils.sourcecode.SourceCode'>, <class 'object'>)})
tests

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
timestamp

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
tools

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
uuid

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
validate_data()
validated_data()
variant_key = 'memory.variant'
variants

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
vcs

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
class rezplugins.package_repository.memory.MemoryVariantResource(variables=None)[source]

Bases: rez.package_resources.VariantResourceHelper

key = 'memory.variant'
parent

Simple property caching descriptor.

Example

>>> class Foo(object):
>>>     @cached_property
>>>     def bah(self):
>>>         print('bah')
>>>         return 1
>>>
>>> f = Foo()
>>> f.bah
bah
1
>>> f.bah
1
repository_type = 'memory'
rezplugins.package_repository.memory.register_plugin()[source]