From 1bc40b32a54b31c7189b44f2257bd6a2d7910e0d Mon Sep 17 00:00:00 2001 From: Joseph Yu Date: Tue, 30 Mar 2021 11:01:17 +0100 Subject: [PATCH] Squashed commit of: 2.77.1..8d51e292 commit 8d51e292dea136c7b742d381a5bc35e15d2921da Author: Joseph Yu Date: Mon Apr 27 15:16:37 2020 +0100 Emphasised pip CLI warnings commit e0d698e42ae2bfdd77a4e1fe7f9450b4d10716ca Author: Joseph Yu Date: Wed Apr 22 11:36:00 2020 +0100 Extra links to install from GitHub commit 13183cf3b49d00ff4c7c12820b1232bebec81478 Author: Joseph Yu Date: Wed Apr 22 10:56:48 2020 +0100 Updated CLI in rez-env warning commit e9221723653335626503a2038fc44a290de7e180 Author: Joseph Yu Date: Sat Apr 18 17:39:40 2020 +0100 Just update Installation.md See nerdvegas/rez#878 for CI check --- wiki/pages/Installation.md | 49 ++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/wiki/pages/Installation.md b/wiki/pages/Installation.md index 00bd4ac27..de5e0a218 100644 --- a/wiki/pages/Installation.md +++ b/wiki/pages/Installation.md @@ -26,30 +26,49 @@ source /opt/rez/completion/complete.sh ## Installation Via Pip -It is possible to install rez with pip, like so: +It is possible to install rez with pip, like so (from source root directory): ``` -]$ pip install rez +]$ pip install --target /opt/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. +The `.` (dot) can also be replaced with link to the GitHub repository, +e.g. choose from: -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. + - `git+https://github.com/nerdvegas/rez.git` if you have git installed + - `https://github.com/nerdvegas/rez/archive/master.zip` + - `https://github.com/nerdvegas/rez/archive/master.tar.gz` -Note that running pip-installed rez command line tools will print a warning like so: +> [[media/icons/warning.png]] The [PyPi rez](https://pypi.org/project/rez) is +> not up to date as of writing. Avoid `pip install rez` -``` -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/nerdvegas/rez/wiki/Installation#why-not-pip-for-production -for futher details. -``` +The environment variables to activate `rez` will be slightly different: + +1. Add `/opt/rez` to `PYTHONPATH` for API e.g. `python -c 'import rez` +2. Add `/opt/rez/bin` to `PATH` for CLI, e.g. `rez-env` + > [[media/icons/warning.png]] For these pip based installs, rez command line + > tools **are not guaranteed to work correctly** inside a rez environment, + > i.e. `rez-env` then running `rez-context` inside sub-shell. + > + > See [Why Not Pip For Production?](#why-not-pip-for-production) below. + > You will also be warned with the following message in the terminal: + > ``` + > 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/nerdvegas/rez/wiki/Installation#why-not-pip-for-production + > for further details. + > ``` +Alternatively, if you already have `rez` setup and have `pip>=19` available, +you can then install `rez` as a `rez` package by using: + + ]$ rez-pip --install . + +Pip installation is adequate however, if all you require is the rez API, or you +don't require its command line tools (`rez-context`, `rez-search`, `rez-view`, +etc) to be available within a resolved environment. -## Why Not Pip For Production? +### 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.