Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wiki] Changes to pip install command #749

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 34 additions & 15 deletions wiki/pages/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down