Skip to content

Commit

Permalink
Updated Installation, added workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Yu authored and j0yu committed Apr 18, 2020
1 parent 6223219 commit 6b82114
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 5 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/installation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Installation
on: [push]

jobs:
linux:
name: ${{ matrix.python-version }} - ${{ matrix.method }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '2.7'
- '3.6'
- '3.7'
method:
- 'python ./install.py'
- 'pip install --target /opt/rez .'
include:
- method: 'python ./install.py'
exports: 'PATH=${PATH}:/opt/rez/bin/rez'
- method: 'pip install --target /opt/rez .'
exports: 'PATH=${PATH}:/opt/rez/bin PYTHONPATH=${PYTHONPATH}:/opt/rez'

steps:
- name: Checkout
uses: actions/checkout@master

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install
run: |
${{ matrix.method }}
find /opt/rez/ -maxdepth 2
- name: rez status
run: |
export ${{ matrix.exports }}
rez status
- name: rez-pip --install .
run: |
export ${{ matrix.exports }}
rez-pip --install .
rez view rez
- name: Import rez package in Python
run: |
export ${{ matrix.exports }}
# Still needed as there's no fallback to use system's python
rez bind python
echo "Checking rez as python package: ==========================================="
rez env rez -- python -c 'import rez;print(rez.__file__)'
20 changes: 15 additions & 5 deletions wiki/pages/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,25 @@ 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 environment variables to activate `rez` will be slightly different:

- Add `/opt/rez/bin` to `PATH`
- Add `/opt/rez` to `PYTHONPATH`

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 .

However, these methods 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.
Expand Down

0 comments on commit 6b82114

Please sign in to comment.