galaxy.tools.expressions package

galaxy.tools.expressions.do_eval(expression: str, jobinput: MutableMapping[str, bool | str | int | float | CWLFileType | CWLDirectoryType | MutableSequence[CWLOutputType | None] | MutableMapping[str, CWLOutputType | None] | None], javascript_requirements: list[JavascriptRequirement] | None = None, outdir: str | None = None, tmpdir: str | None = None, context: bool | str | int | float | CWLFileType | CWLDirectoryType | MutableSequence[CWLOutputType | None] | MutableMapping[str, CWLOutputType | None] | None = None, sandbox_command: Sequence[str] | None = None)[source]
galaxy.tools.expressions.evaluate(config, input)[source]
exception galaxy.tools.expressions.ExpressionTemplateError(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

A $(...)/${...} block in a tool template does not parse.

galaxy.tools.expressions.find_engine(config)[source]
galaxy.tools.expressions.register() → None[source]

Install the sandboxed engine as the process-wide cwl_utils JS engine.

Idempotent and thread-safe. Call before any expression is evaluated so no code path falls back to the unsafe Node vm engine.

galaxy.tools.expressions.resolve_isolation_command(setting: str) → tuple[str, ...] | None[source]

Resolve the expression_evaluation_isolation_command setting to a wrapper.

  • empty -> None (ordinary worker subprocess)

  • "bubblewrap"/"bwrap" -> the built-in bubblewrap command, but only on Linux with bwrap on PATH; otherwise None (ordinary worker subprocess) with a one-time warning, so a macOS dev box or a host without bubblewrap degrades cleanly

  • anything else -> the value parsed as a literal command prefix, used as-is

Cached so the PATH lookup and any warning happen once per distinct setting.

galaxy.tools.expressions.validate_expression_template(expression: str, description: str = 'command template') → None[source]

Reject a template the expression scanner cannot read before evaluating it.

galaxy.tools.expressions.write_evalute_script(in_directory)[source]

Responsible for writing the script that evaluates expressions in Galaxy jobs.

Submodules

galaxy.tools.expressions.evaluation module

exception galaxy.tools.expressions.evaluation.ExpressionTemplateError(err_msg: str | None = None, type='info', **extra_error_info)[source]

Bases: MessageException

A $(...)/${...} block in a tool template does not parse.

galaxy.tools.expressions.evaluation.validate_expression_template(expression: str, description: str = 'command template') → None[source]

Reject a template the expression scanner cannot read before evaluating it.

galaxy.tools.expressions.evaluation.do_eval(expression: str, jobinput: MutableMapping[str, bool | str | int | float | CWLFileType | CWLDirectoryType | MutableSequence[CWLOutputType | None] | MutableMapping[str, CWLOutputType | None] | None], javascript_requirements: list[JavascriptRequirement] | None = None, outdir: str | None = None, tmpdir: str | None = None, context: bool | str | int | float | CWLFileType | CWLDirectoryType | MutableSequence[CWLOutputType | None] | MutableMapping[str, CWLOutputType | None] | None = None, sandbox_command: Sequence[str] | None = None)[source]
galaxy.tools.expressions.evaluation.evaluate(config, input)[source]

galaxy.tools.expressions.script module

galaxy.tools.expressions.script.write_evalute_script(in_directory)[source]

Responsible for writing the script that evaluates expressions in Galaxy jobs.

galaxy.tools.expressions.util module

galaxy.tools.expressions.util.find_engine(config)[source]