Descriptors¶
Descriptor¶
- class DescriptorRegistry(config, interface=<class 'zoo.core.plugin.plugin.Plugin'>, variableName=None)¶
Bases:
PluginManager
A registry for package version descriptors.
This class is responsible for managing the descriptors used the zootools environment. It loads descriptors from a cache generated from the Zoo class Instance, and it can generate this cache on demand.
- Parameters:
interface (class) – The plugin interface. Defaults to
Descriptor
.variableName (str) – The name of the variable to hold the plugins. Defaults to None.
- generateCache()¶
Generate the descriptor cache.
- descriptorForPackages(*packageNames)¶
Get the descriptors for a given set of package names.
- Parameters:
packageNames (tuple of str) – The names of the packages to get descriptors for.
- Returns:
The descriptor plugins for the given packages, or None if the package is not found.
- Return type:
list of
Descriptor
- descriptorFromDict(info)¶
Get the descriptor plugin for a given descriptor dictionary.
- Parameters:
info (dict) – The descriptor dictionary to get the plugin for.
- Returns:
The descriptor plugin for the given dictionary.
- Return type:
- descriptorFromPath(location, descriptorInfo)¶
Returns the matching Descriptor object for the given path.
- Parameters:
location (str) – The location of the package, can be any of the paths supported by our descriptors. i.e a .git path, physical path etc
descriptorInfo (dict) – Descriptor dic see
Descriptor
for more info.
- Returns:
- Return type:
- Raise:
NotImplementedError
- class Descriptor(config, descriptorDict, manager=None)¶
Bases:
Plugin
A descriptor represents an identifiable item that can be used to resolve or install dependencies.
- Parameters:
config (
zoo.core.manager.Zoo
) – The zoo config instancedescriptorDict (dict) – The Descriptor dict containing at least the type and name
- LOCAL_PATH = 'path'¶
- ZOOTOOLS = 'zootools'¶
- requiredkeys = ()¶
- isDescriptorOfType(descriptorType)¶
- property package¶
Returns the zoo package instance attached to this descriptor or None
- Returns:
The zoo package for the descriptor
- Return type:
- serialize()¶
- installed()¶
- resolve(*args, **kwargs)¶
- install(**arguments)¶
- uninstall(remove=False)¶
- class GitDescriptor(config, descriptorDict)¶
Bases:
Descriptor
- id = 'git'¶
- requiredkeys = ('type', 'version', 'path')¶
- resolve(*args, **kwargs)¶
- install(**arguments)¶