mottosso / rez-localz

Package localisation for Rez
The Unlicense
10 stars 2 forks source link

Minimum Viable Product #2

Closed mottosso closed 5 years ago

mottosso commented 5 years ago

Goal

Test the concept, as specified in #1

Implementation

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

The above command should make python-2.7.16 available locally under these conditions.

mottosso commented 5 years ago

Got a first draft of this.

Basic operation

localz1

Protect against duplicates

localz2

Next step is resolving a given request, to copy more than just the specific request. Then this MVP is done and ready to move towards a 1.0.

mottosso commented 5 years ago

All done.

Notice how the version of maya changes, based on what other requirements there are.

localz3

Also notice that, as a side-effect of resolving the request, you can also pass multiple requests that resolve together (and are thus compatible) and are each localised. Here's you'll also see the existing-package detection in action, given I already had the alita package localised.

localz4

Finally the full CLI interface as of this writing.

$ rez env localz -- localise --help
usage: localz [-h] [--version] [--requires PKG [PKG ...]] [--all-variants]
              [--paths PATH [PATH ...]] [-f] [-v]
              [PKG [PKG ...]]

Localise packages from one location to another, to improve
performance or facilitate remote collaboration on software
or content.

positional arguments:
  PKG                   Packages to localize

optional arguments:
  -h, --help            show this help message and exit
  --version             Print version and exit
  --requires PKG [PKG ...]
                        Localise request, fulfilling these requirements
  --all-variants        Copy not just the resolved variant, but all of them
  --paths PATH [PATH ...]
                        Package search path (ignores --no-local if set)
  -f, --force           Copy package even if it isn't relocatable (use at your
                        own risk)
  -v, --verbose

examples:
  Latest available version of Maya
  $ rez env localz -- localise maya

  Version of Maya, required by Alita
  $ rez env localz -- localise maya --requires alita

  Series of requests, all compatible with each other
  $ rez env localz -- localise six-1 maya-2018 python-3.7

What's next

With a fully resolved context, there's a line in there to exclude anything that wasn't in the original request. Next I'd like an option to skip that, and localise all packages part of a request. In the case of maya alita, I'm expecting 10+ packages to be resolved given alita has a number of additional requirements, and that some requirements are weakly dependent on exactly maya.