forked from AcademySoftwareFoundation/rez
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
126 lines (88 loc) · 5.24 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
Introduction
------------
Rez is a cross-platform, LGPL Licensed python library and set of utilities for building and installing packages, and resolving environments containing these packages at runtime, avoiding version conflicts. The main tools are:
- **rez-env** - Creates a configured shell containing a set of requested packages. Supports **bash** and **tcsh**, and mimics the startup sequences of the native shell.
- **rez-build** - Builds a package of any type (python, C++ etc), and installs it locally for testing. Supports **cmake**.
- **rez-release** - Builds and centrally deploys a package, and updates the associated source control repository (creating tags etc). Supports **git**, **mercurial** and **svn**.
Unlike many packaging systems, Rez is able to install many different versions of the same packages. When you use the rez-env tool, a new environment is dynamically created, containing the requested packages. Rez resolves environments at runtime, rather than install time - however, you are able to store a resolve to disk, and reuse it at a later date.
Here's an example which places the user into a resolved shell containing the requested packages:
::
]$ rez-env requests-2.2+ python-2.6 'pymongo-0+<2.7'
You are now in a rez-configured environment.
resolved by [email protected], on Wed Feb 26 15:56:20 2014, using Rez v2.0.0
requested packages:
requests-2.2+
python-2.6
pymongo-0+<2.7
resolved packages:
python-2.6.8 /software/ext/python/2.6.8
platform-linux /software/ext/platform/linux
requests-2.2.1 /software/ext/requests/2.2.1/python-2.6
pymongo-2.6.3 /software/ext/pymongo/2.6.3
arch-x86_64 /software/ext/arch/x86_64
> ]$ _
Here's an example which creates an environment containing the package 'houdini' version 12.5 or greater, and runs the command 'hescape -h' inside that environment:
::
]$ rez-env -c 'hescape -h' houdini-12.5+
Usage: hescape [-foreground] [-s editor] [filename ...]
-h: output this usage message
-f: force the use of asset definitions in OTL files on the command line
-s: specify starting desktop by name
-foreground: starts process in foreground
Resolved environments can also be created programmatically:
::
>>> from rez.resolved_context import ResolvedContext
>>>
>>> r = ResolvedContext(["houdini-12.5+", "houdini-0+<13", "java", "!java-1.8+"])
>>>
>>> r.print_info()
resolved by [email protected], on Wed Feb 26 13:03:30 2014, using Rez v2.0.0
requested packages:
houdini-12.5+
houdini-0+<13
java
resolved packages:
java-1.7.21 /software/ext/java/1.7.21
platform-linux /software/ext/platform/linux
arch-x86_64 /software/ext/arch/x86_64
houdini-12.5.562 /software/ext/houdini/12.5.562
>>>
>>> import subprocess
>>> p = r.execute_shell(command='which hescape', stdout=subprocess.PIPE)
>>> stdout,stderr = p.communicate()
>>>
>>> print stdout
'/software/ext/houdini/12.5.562/bin/hescape'
Features
--------
- Supports Linux and OSX;
- Allows for a fast and efficient build-install-test cycle;
- Creates shells of type: bash, tcsh, other (shells can be added as plugins);
- Contains a deployment system supporting git, mercurial and svn (as plugins);
- Environment resolves can be saved to disk and reused at a later date (a bit like VirtualEnv);
- Highly pluggable, supports five different plugin types to do things from adding new shell types, to adding new build systems;
- Contains a version resolving algorithm, for avoiding version clashes;
- Visualises resolved environments in a rendered dot-graph;
- Packages are found in a search path, so different packages can be deployed to different locations;
- Supports alphanumeric version numbers;
- Has a powerful version requirements syntax, able to describe any version range, and a conflict operator for rejecting version ranges;
- Package 'variants' - a way to define different flavors of the same package version, for example a plugin built for multiple versions of the host app;
- Custom release hooks (such as post-release operations) can be added as plugins;
- Has a time lock feature, which allows old resolves to be recreated (newer packages are ignored);
- Package definitions are a single, succinct file;
- Packages define their effect on the environment (adding to PATH etc) in a platform- and shell- agnostic way, using a dedicated python API;
- Has a memcached-based caching system, for caching environment resolves.
Installation
------------
To install Rez, download the source, and then from the source directory, run the following command (replacing DEST_DIR with your preferred installation path):
::
python ./install.py -v DEST_DIR
This performs a 'production' install - a standalone installation that ensures that the Rez command line tools are always available, even when within a resolved environment. You can also install Rez as a standard python package, although if you do this, the command line tools are only available some of the time. To install Rez as a standard python module:
::
pip install rez
Or, to install from source:
::
python setup.py install
Documentation
-------------
TODO