Skip to content

Commit

Permalink
Replace references to wiki with https://rez.readthedocs.io
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso committed Oct 28, 2023
1 parent b4e0953 commit e5f6364
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 91 deletions.
83 changes: 1 addition & 82 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,82 +1 @@
## Installation Script

To install rez, download the source. Then from the root directory, run:

```
]$ python ./install.py
```

This installs rez to `/opt/rez`. See `install.py -h` for how to install to a
different location.

Once the installation is complete, a message tells you how to run it:

```
SUCCESS! To activate Rez, add the following path to $PATH:
/opt/rez/bin/rez
You may also want to source the completion script (for bash):
source /opt/rez/completion/complete.sh
```

> [[media/icons/warning.png]] Do _not_ move the installation - re-install to a new
> location if you want to change the install path. If you want to install rez for
> multiple operating systems, perform separate installs for each of those systems.

## Installation Via Pip

It is possible to install rez with pip, like so:

```
]$ pip install rez
```

However, this comes with a caveat - rez command line tools _are not guaranteed
to work correctly_ once inside a rez environment (ie after using the `rez-env`
command). The reasons are given in the next section.

Pip installation is adequate however, if all you require is the rez API, or you
don't require its command line tools to be available within a resolved environment.

Note that running pip-installed rez command line tools will print a warning like so:

```
Pip-based rez installation detected. Please be aware that rez command line tools
are not guaranteed to function correctly in this case. See
https://github.com/AcademySoftwareFoundation/rez/wiki/Installation#why-not-pip-for-production
for futher details.
```


## Why Not Pip For Production?

Rez is not a normal python package. Although it can successfully be installed
using standard mechanisms such as pip, this comes with a number of caveats.
Specifically:

* When within a rez environment (ie after using the `rez-env` command), the rez
command line tools are not guaranteed to function correctly;
* When within a rez environment, other packages' tools (that were also installed
with pip) remain visible, but are not guaranteed to work.

When you enter a rez environment, the rez packages in the resolve configure
that environment as they see fit. For example, it is not uncommon for a python
package to append to PYTHONPATH. Environment variables such as PYTHONPATH
affect the behaviour of tools, including rez itself, and this can cause it to
crash or behave abnormally.

When you use the `install.py` script to install rez, some extra steps are taken
to avoid this problem. Specifically:

* Rez is installed into a virtualenv so that it operates standalone;
* The rez tools are shebanged with `python -E`, in order to protect them from
environment variables that affect python's behaviour;
* The rez tools are stored in their own directory, so that other unrelated tools
are not visible.

Due to the way standard wheel-based python installations work, it simply is not
possible to perform these extra steps without using a custom installation script.
Wheels do not give the opportunity to run post-installation code; neither do
they provide functionality for specifying interpreter arguments to be added for
any given entry point.
See https://rez.readthedocs.io/en/stable/installation.html for installation instructions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ environments reference these existing packages. This means that configured envir
are lightweight, and very fast to create, often taking just a few seconds to configure
despite containing hundreds of packages.

See [the wiki](https://github.com/AcademySoftwareFoundation/rez/wiki) for full documentation.
See [the wiki](https://rez.readthedocs.io) for full documentation.

<p align="center">
<a href="https://github.com/AcademySoftwareFoundation/rez/wiki/media/other_pkg_mgr.png">
<img src="https://github.com/AcademySoftwareFoundation/rez/wiki/media/other_pkg_mgr.png"></a>
<a href="https://github.com/AcademySoftwareFoundation/rez/raw/main/docs/source/_static/other_pkg_mgr.png">
<img src="https://github.com/AcademySoftwareFoundation/rez/raw/main/docs/source/_static/other_pkg_mgr.png"></a>
<br><i>Typical package managers install packages into an environment</i>
</p>

<br>
<p align="center">
<a href="https://github.com/AcademySoftwareFoundation/rez/wiki/media/rez_pkg_mgr.png">
<img src="https://github.com/AcademySoftwareFoundation/rez/wiki/media/rez_pkg_mgr.png"></a>
<a href="https://github.com/AcademySoftwareFoundation/rez/raw/main/docs/source/_static/rez_pkg_mgr.png">
<img src="https://github.com/AcademySoftwareFoundation/rez/raw/main/docs/source/_static/rez_pkg_mgr.png"></a>
<br><i>Rez installs packages once, and configures environments dynamically</i>
</p>

Expand Down Expand Up @@ -90,7 +90,7 @@ and when re-evaluated later will reconstruct the same environment once more.
## Examples

This example places the user into a resolved shell containing the requested packages,
using the [rez-env](https://github.com/AcademySoftwareFoundation/rez/wiki/Command-Line-Tools#rez-env) tool:
using the [rez-env](https://rez.readthedocs.io/en/stable/commands/rez-env.html) tool:

]$ rez-env requests-2.2+ python-2.6 'pymongo-0+<2.7'

Expand Down
2 changes: 1 addition & 1 deletion src/rez/cli/_entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def check_production_install():
sys.stderr.write(
"Pip-based rez installation detected. Please be aware that rez command "
"line tools are not guaranteed to function correctly in this case. See "
"https://github.com/AcademySoftwareFoundation/rez/wiki/Installation#why-not-pip-for-production "
"https://rez.readthedocs.io/en/stable/installation.html#why-not-pip-for-production "
" for futher details.\n"
)

Expand Down
2 changes: 1 addition & 1 deletion src/rez/package_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def add_variant(self, variant, force=False):

# Package belongs to a temp repo (this occurs when a package is
# tested on pre_build/pre_release - see
# https://github.com/AcademySoftwareFoundation/rez/wiki/Package-Definition-Guide#tests)
# https://rez.readthedocs.io/en/stable/package_definition.html#tests)
#
if package.repository.name() == "filesystem" and \
package.repository.location.startswith(config.tmpdir + os.sep):
Expand Down
2 changes: 1 addition & 1 deletion src/rez/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def wrapper(self, *args, **kwargs):
else:
self.skipTest(
"Must be run via 'rez-selftest' tool, see "
"https://github.com/AcademySoftwareFoundation/rez/wiki/Installation#installation-script"
"https://rez.readthedocs.io/en/stable/installation.html#installation-script"
)
return wrapper
return decorator
Expand Down

0 comments on commit e5f6364

Please sign in to comment.