Home

Awesome

<img width=300 src=https://user-images.githubusercontent.com/2152766/60191937-07018080-982d-11e9-971b-43e2dbc75963.png>

Package localisation for Rez.

See also

<br>

What is "localisation"?

Localise - To make something remote local

Once local, access to a given package no longer requires access to the original (e.g. network) location and yields performance equivalent to that of local access, such as from your SSD. SSDs typically read at 100-500mb/sec, with some capable of 1GB+/sec. NVRAM disks are even quicker, making network access akin to sending physical letters compared to email.

Example

Localisation is already possible with Rez like this.

$ export REZ_LOCAL_PACKAGES_PATH=~/packages
$ rez cp packageA-1.0.0 --dest-path=$REZ_LOCAL_PACKAGES_PATH

Now version packageA-1.0.0 is "localised", in that it is accessible from a local directory, as opposed to wherever it came from. Assuming REZ_LOCAL_PACKAGES_PATH is first in REZ_PACKAGES_PATH, this package would get picked up first.

This project is an extension of this, with additional features such as:

<br>

Usage

localz8

Prerequisities

Used as a Rez package.

$ git clone https://github.com/mottosso/rez-localz.git
$ cd rez-localz
$ rez build --install

Once installed, you can start localising packages like this.

$ rez env localz -- localise mypackage

The package mypackage would then be localised to ~/.packages.

Customise Destination

Localised packages default to ~/.packages, which resides next to your "local" a.k.a. "development" package path, ~/packages. Customise the destination path using either an environment variable or command-line argument.

$ export REZ_LOCALISED_PACKAGES_PATH=~/localised_packages
$ rez env localz -- localise Qt.py --prefix "~/localised_packages"

The argument takes precedence over the environment variable.

Multiple requests

Localise multiple packages at once, that all resolve to one another making sure they work together.

$ rez env localz -- localise maya-2018 arnold flex
Full context

Localise an entire context with the --full flag.

$ rez env localz -- localise maya alita gitlab --full
Limited by requirements

Localise one package resolved with another.

$ rez env localz -- localise maya --requires alita

In this case, if alita carries a requirement for maya-2018 then that's the version being localised, despite maya-2017 and maya-2019 also being available.

Specific localisation

The syntax to localise is the same as for rez env, including complex version queries.

$ rez env localz -- localise "maya-2015,<2020"
All Variants

Pass --all-variants to include every variant for a given package, rather than the one that matches the current resolve.

$ rez env localz -- localise python --all-variants

The above could include both Linux and Windows variants for the latest version of python.

<br>

FAQ

<blockquote>What about <code>rez cp</code>?</blockquote>

localise uses rez cp under the hood and can be considered high-level version of it, taking more variables into account like context and other packages.