rez.utils.sourcecode#

rez.utils.sourcecode.early()#

Used by functions in package.py to harden to the return value at build time.

The term ‘early’ refers to the fact these package attribute are evaluated early, ie at build time and before a package is installed.

rez.utils.sourcecode.late()#

Used by functions in package.py that are evaluated lazily.

The term ‘late’ refers to the fact these package attributes are evaluated late, ie when the attribute is queried for the first time.

If you want to implement a package.py attribute as a function, you MUST use this decorator - otherwise it is understood that you want your attribute to be a function, not the return value of that function.

rez.utils.sourcecode.include(module_name, *module_names)#

Used by functions in package.py to have access to named modules.

See the ‘package_definition_python_path’ config setting for more info.

exception rez.utils.sourcecode.SourceCodeError#

Bases: Exception

__init__(msg, short_msg)#
__new__(**kwargs)#
add_note()#

Exception.add_note(note) – add a note to the exception

args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception rez.utils.sourcecode.SourceCodeCompileError#

Bases: SourceCodeError

__init__(msg, short_msg)#
__new__(**kwargs)#
add_note()#

Exception.add_note(note) – add a note to the exception

args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception rez.utils.sourcecode.SourceCodeExecError#

Bases: SourceCodeError

__init__(msg, short_msg)#
__new__(**kwargs)#
add_note()#

Exception.add_note(note) – add a note to the exception

args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class rez.utils.sourcecode.SourceCode#

Bases: object

Wrapper for python source code.

This object is aware of the decorators defined in this sourcefile (such as ‘include’) and deals with them appropriately.

__init__(source=None, func=None, filepath=None, eval_as_function=True)#
copy()#
includes()#
late_binding()#
evaluated_code()#
property sourcename#
compiled()#
set_package(package)#
exec_(globals_={})#
to_text(funcname)#
class rez.utils.sourcecode.IncludeModuleManager#

Bases: object

Manages a cache of modules imported via @include’ decorator.

include_modules_subpath = '.rez/include'#
__init__()#
load_module(name, package)#