Skip to content

How to Build and Release packages with OS/Platform variants #1547

Discussion options

You must be logged in to vote

One way to solve this is to use the expand_requires function like this:

@early
def variants():
    import platform
    from rez.package_py_utils import expand_requires

    if platform.system() not in ["Linux", "Windows"]:
        # I'm not 100% sure what exception we should raise though.
        raise RuntimeError("asdasd")

    return [["maya-2022"] + expand_requires("platform-**")]

See https://rez.readthedocs.io/en/stable/api/rez.package_py_utils.html#rez.package_py_utils.expand_requires and https://rez.readthedocs.io/en/stable/package_definition.html#early-binding-functions.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kalmarmeter
Comment options

Answer selected by kalmarmeter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants