rez-python-api
БесплатноБез исполняемых скриптовНе проверенRez Python API — ResolvedContext construction and inspection, Package/Variant objects, programmatic resolves, .rxt context serialisation and deserialisation…
от loonghao346 установок в других каталогахОб этом скилле
Rez Python API
One-sentence summary:
ResolvedContextis the whole product — build one from a list of request strings, read the result offsuccess,resolved_packagesandget_environ(), persist it withsave()/load(), and only open a shell throughexecute_shell()when you really need one.
Skill scope: embedding rez in Python. For the CLI equivalents see rez-cli; for solver internals see
rez-resolve; for a context used as a deliverable artifact see rez-suites-bundles.
Before you embed rez
Two warnings straight from upstream docs/source/api.rst, and both change the design of a tool:
- There are no compatibility guarantees between rez versions. Pin the rez you import, the same
way the CLI lanes in this repository pin
REZ_VERSION. - Config is read once, at first import. The Python API cannot reread configuration files or
switch to a different
REZ_CONFIG_FILEafterwards. A tool that has to change config mid-run must shell out to the CLI instead.
Confirm what you are actually about to import before you trust any of the code below:
rez-status
Module entry points
| Module | What it holds |
|---|---|
rez.resolved_context |
ResolvedContext — a resolve, and everything you do with one |
rez.packages |
Package, Variant, iter_packages, get_package, get_variant, get_latest_package_from_string |
rez.config |
config — the merged, live settings object |
rez.resolver, rez.solver |
Resolver, ResolverStatus, the solver itself |
rez.suite |
Suite — see rez-suites-bundles |
rez.bundle_context |
bundle_context — see rez-suites-bundles |
rez.pip |
pip_install_package — see rez-pip-integration |
rez.developer_package |
build a package from source in-process |
rez.package_repository, rez.package_resources |
repositories and the resources they hand out |
rez.version |
Version, VersionRange, Requirement, RequirementList, VersionError |
rez.exceptions |
every rez error type; all of them derive from RezError |
rez.wrapper |
the module behind the main console script |
Constructing a context
from rez.resolved_context import ResolvedContext
# Requests are plain strings, exactly what you would pass to rez-env.
context = ResolvedContext(["foo-1", "bar"])
if not context.success:
raise SystemExit(context.failure_description)
ResolvedContext(requests, ...) takes the request list positionally. The arguments worth knowing:
| Argument | Meaning |
|---|---|
verbosity |
0, 1 or 2 — the same levels rez-env -v gives you |
timestamp |
epoch time; ignore packages released after it |
building / testing |
resolve as if for rez-build / rez-test |
caching |
None defers to the resolve_caching setting; False bypasses caches |
package_paths |
override packages_path for this resolve only |
package_filter |
a PackageFilterList; rez.package_filter.no_filter removes filtering |
add_implicit_packages |
append the implicit_packages (default True) |
max_fails / time_limit |
stop after N failures / after N seconds |
Set verbosity=1 before reaching for a debugger: the solver trace is the same one rez-env -v
prints.
Reading the result
context.status # ResolverStatus.solved | .failed | .aborted | .pending
context.success # True when status is solved
context.failure_description # why it failed, when it did
context.requested_packages() # [Requirement, ...] — the request; implicits only if include_implicit=True
context.resolved_packages # [Variant, ...] — what the solver picked
context.resolved_ephemerals # resolved ephemeral (implicit-ish) packages
context.get_resolve_as_exact_requests() # ['foo==1.1.0', ...] — pin the resolve down
context.get_environ() # dict: the environment the context would produce
context.get_tools() # {tool_name: (Variant, [alias, ...])}
context.which("foo") # absolute path to a tool, or None
context.get_resolved_package("foo") # the Variant, or None
context.print_info(source_order=True) # the rez-context --so view, on stdout
resolved_packages yields Variant objects, not Package objects. A Package is a family; a
Variant is one resolved member of it, with .name, .version, .qualified_name, .root,
.requires, .tools and .data on it. Reach for get_resolved_package(name) when you want one
package out of a resolve, and get_environ() when you want the environment without running
anything.
Context files (.rxt)
A context serialises to a .rxt file, which is how a resolve becomes something you can hand to
another process, another machine, or another day:
context.save("context.rxt") # write it
same = ResolvedContext.load("context.rxt") # read it back
# Or keep it in memory:
from io import StringIO
buf = String
Установить rez-python-api в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл rez-python-api?
Rez Python API — ResolvedContext construction and inspection, Package/Variant objects, programmatic resolves, .rxt context serialisation and deserialisation, running commands inside a context, and the module entry points (rez.resolved_context, rez.packages, rez.config, rez.pip, rez.suite, rez.bundle_context). Use when the user wants to drive rez from Python instead of the CLI, or asks what a context object actually holds. Covers Rez 3.4.0.
Как установить скилл rez-python-api?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rez-python-api запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic