diff --git a/.github/workflows/wiki-doctest-installation.yml b/.github/workflows/wiki-doctest-installation.yml new file mode 100644 index 0000000000..b8f4b9e407 --- /dev/null +++ b/.github/workflows/wiki-doctest-installation.yml @@ -0,0 +1,60 @@ +# JUST AN EXPERIMENT - delete/replace as necessary before merge +name: Wiki - doctest Installation +on: [push] + +jobs: + linux: + name: Debian (Python) - install + runs-on: ubuntu-latest + container: python:${{ matrix.python-version }} + strategy: + matrix: + python-version: ['2.7', '3.7'] + + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Default python install.py + run: | + python install.py + test -d /opt/rez/bin/rez + test -d /opt/rez/completion + + - name: pip install --target + run: | + pip install --ignore-installed --force-reinstall --target target . + cd target + echo + echo "===========================================" + echo "Installed into (pwd, maxdepth 2):" + pwd + echo "===========================================" + find . -maxdepth 2 ! -name '*.pyc' -ls + + - name: pip install --prefix + run: | + pip install --ignore-installed --force-reinstall --prefix prefix . + cd prefix + echo + echo "===========================================" + echo "Installed into (pwd, maxdepth 5):" + pwd + echo "===========================================" + find . -maxdepth 5 ! -name '*.pyc' -ls + + - name: rez-pip --install + run: | + python install.py + export PATH=${PATH}:/opt/rez/bin/rez + echo "===========================================" + rez-pip --install . + echo "===========================================" + rez view rez + cd $(find $HOME/packages/rez -maxdepth 2 -type d | tail -1) + echo + echo "===========================================" + echo "Installed as rez package (pwd, maxdepth 3):" + pwd + echo "===========================================" + find -maxdepth 3 ! -name '*.pyc' -ls \ No newline at end of file diff --git a/src/rez/pip.py b/src/rez/pip.py index 0bc5beae10..747aef0a05 100644 --- a/src/rez/pip.py +++ b/src/rez/pip.py @@ -7,6 +7,7 @@ from rez.vendor.distlib.markers import interpret from rez.vendor.distlib.util import parse_name_and_version from rez.vendor.enum.enum import Enum +from rez.vendor.six.six.moves import StringIO from rez.resolved_context import ResolvedContext from rez.utils.system import popen from rez.utils.pip import get_rez_requirements, pip_to_rez_package_name, \ @@ -19,7 +20,6 @@ from rez.system import System from tempfile import mkdtemp -from StringIO import StringIO from pipes import quote from pprint import pformat import subprocess diff --git a/src/rez/plugin_managers.py b/src/rez/plugin_managers.py index c10faf32ba..16788f9284 100644 --- a/src/rez/plugin_managers.py +++ b/src/rez/plugin_managers.py @@ -158,7 +158,7 @@ def load_plugins(self): self.failed_plugins[nameish] = str(e) if config.debug("plugins"): import traceback - from StringIO import StringIO + from rez.vendor.six.six.moves import StringIO out = StringIO() traceback.print_exc(file=out) print_debug(out.getvalue()) diff --git a/src/rezgui/dialogs/ResolveDialog.py b/src/rezgui/dialogs/ResolveDialog.py index 230ccc16fe..37d8c83afd 100644 --- a/src/rezgui/dialogs/ResolveDialog.py +++ b/src/rezgui/dialogs/ResolveDialog.py @@ -7,8 +7,8 @@ from rezgui.objects.ResolveThread import ResolveThread from rezgui.objects.App import app from rez.vendor.version.requirement import Requirement +from rez.vendor.six.six.moves import StringIO from rez.config import config -import StringIO class ResolveDialog(QtGui.QDialog, StoreSizeMixin): @@ -274,7 +274,7 @@ def _resolve_finished(self): if self.resolver.success(): if self.advanced: - sbuf = StringIO.StringIO() + sbuf = StringIO() self.resolver.context.print_info(buf=sbuf) msg = "\nTHE RESOLVE SUCCEEDED:\n\n" msg += sbuf.getvalue() diff --git a/wiki/pages/Installation.md b/wiki/pages/Installation.md index 00bd4ac275..c839f5f8a5 100644 --- a/wiki/pages/Installation.md +++ b/wiki/pages/Installation.md @@ -26,13 +26,19 @@ 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 . ``` -However, this comes with a caveat - rez command line tools _are not guaranteed +If you already have `rez` setup, you could also try: + +``` +]$ rez-pip --install . +``` + +However, these 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.