rez-package-definition
БесплатноБез исполняемых скриптовНе проверенAuthoring Rez package.py files — standard attributes, early/late binding functions, requires/variants/build_requires, string expansion and package overrides…
от loonghao369 установок в других каталогахОб этом скилле
Rez package definition (package.py)
One-sentence summary: every variable in
package.pybecomes an attribute of the package;requiresdeclares dependencies andcommands()configures the runtime environment.
Skill scope: the definition file itself. For the commands() body see rez-package-commands;
for requests/version syntax see rez-core-concepts; for builds see rez-cli. For the decisions behind
versions, variants, range width and the build/release loop see rez-package-authoring.
Minimal package
name = "sequence"
version = "2.1.2"
description = "Sequence detection library."
authors = ["ajohns"]
tools = ["lsq", "cpq"]
requires = ["python-2.6+<3", "argparse"]
def commands():
env.PATH.append("{root}/bin")
env.PYTHONPATH.append("{root}/python")
uuid = "6c43d533-92bb-4f8b-b812-7020bf54d3f1"
The file lives at the root of each package install:
/packages/inhouse/foo/1.0.0/package.py.
What becomes a package attribute
Every module-level variable becomes an attribute — including custom ones. These do not:
- Python modules (
import sysdoes not create asysattribute); - plain functions (except
commands,@earlyand@latefunctions); - names with a leading double underscore;
- any build-only attribute.
That list is exactly as wide as it reads, and no wider. A class is not a module and not a
function, so from pathlib import Path at module scope does create a Path attribute — and it is
serialized into the installed package.py as Path = <class 'pathlib.Path'>, which no longer
parses. Same for a class defined in the file and for any object instance. Values derived from a
stripped module survive too: sys_path = sys.prefix is kept, frozen on the build machine. See
rez-package-pitfalls for the errors and the correct form.
Standard attributes
| Attribute | Type | Purpose |
|---|---|---|
name |
str |
package name (required) |
version |
str |
version (required) |
description |
str |
general description, no version details |
authors |
list[str] |
ordered, major contributor first |
requires |
list[str] |
runtime dependencies |
build_requires |
list[str] |
build-time deps, transitive |
private_build_requires |
list[str] |
build-time deps, not transitive |
tools |
list[str] |
entry points exposed into the environment |
variants |
list[list[str]] |
variant definitions (see rez-core-concepts) |
hashed_variants |
bool |
install variants under a hash |
commands() |
function | runtime environment configuration |
uuid |
str |
stable identity across renames |
has_plugins / plugin_for |
bool / str |
plugin discovery via rez-plugins |
cachable |
bool |
allow package caching |
config |
dict |
override rez settings during build/release |
Arbitrary custom attributes are allowed and are often the cleanest way to pass
build-computed data to commands().
requires vs build_requires vs private_build_requires
The build environment requirement list is assembled in this order:
requiresbuild_requires— transitive: build requirements of all packages in the env are includedprivate_build_requires— not transitive- the current variant's requirements
Use private_build_requires for doc generators (doxygen, sphinx), build utilities and
statically linked libraries. Use build_requires for header-only C++ libraries, where consumers
of your headers also need the header at build time.
Early binding functions (@early)
Evaluated at build time; the returned value is baked into the installed package.py.
@early()
def authors():
import subprocess
p = subprocess.Popen("git shortlog -sn | cut -f2",
shell=True, stdout=subprocess.PIPE)
out, _ = p.communicate()
return out.strip().split("\n")
Rules and gotchas:
- Only package attributes are visible — the implicit
thisobject exposes package attributes only. - No rez environment variables are accessible.
- Do not reference other
@earlyor@lateattributes — an error is raised. - CWD during evaluation is the directory containing your
package.py. @earlyfunctions are evaluated multiple times: once pre-build and once per variant. The pre-build value (withbuilding == False) is what lands in the installed package.- Therefore: make sure the function returns the runtime value when
buildingisFalse.
@early()
def requires():
if building:
return ["python-2"]
else:
return ["runtimeonly-1.2", "python-2"]
Objects available during early evaluation: this, building, build_variant_index,
build_variant_requires.
Late binding functions (@late)
Remain as functions in the installed package; evaluated lazily on first access and then cached.
Allowed for: requires, build_requires, private_build_requires, tools, help, and an
Установить rez-package-definition в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл rez-package-definition?
Authoring Rez package.py files — standard attributes, early/late binding functions, requires/variants/build_requires, string expansion and package overrides. Use when writing, reviewing or debugging a package definition file, or when the user asks how to declare dependencies, variants, tools or build-time requirements. Covers Rez 3.4.0.
Как установить скилл rez-package-definition?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rez-package-definition запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic