Skip to content
Open
Show file tree
Hide file tree
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
50 changes: 28 additions & 22 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
import os.path
import textwrap
import subprocess
from optparse import OptionParser
from argparse import ArgumentParser

source_path = os.path.dirname(os.path.realpath(__file__))
bin_path = os.path.join(source_path, "bin")
src_path = os.path.join(source_path, "src")
sys.path.insert(0, src_path)

from rez.utils._version import _rez_version
from rez.backport.shutilwhich import which
from build_utils.virtualenv.virtualenv import Logger, create_environment, \
path_locations
from rez._vendor.shutilwhich import which
from build_utils.virtualenv.virtualenv import (Logger,
create_environment, path_locations)
from build_utils.distlib.scripts import ScriptMaker


Expand Down Expand Up @@ -104,44 +104,50 @@ def copy_completion_scripts(dest_dir):
if __name__ == "__main__":
usage = ("usage: %prog [options] DEST_DIR ('{version}' in DEST_DIR will "
"expand to Rez version)")
parser = OptionParser(usage=usage)
parser.add_option(
'-v', '--verbose', action='count', dest='verbose', default=0,
help="Increase verbosity.")
parser.add_option(
'-s', '--keep-symlinks', action="store_true", default=False,
parser = ArgumentParser(usage=usage)
parser.add_argument('dest_dir')
parser.add_argument(
'-v', '--verbose',
action='count',
dest='verbose',
default=0,
help="Increase verbosity.",
)
parser.add_argument(
'-s', '--keep-symlinks',
action="store_true",
default=False,
help="Don't run realpath on the passed DEST_DIR to resolve symlinks; "
"ie, the baked script locations may still contain symlinks")
opts, args = parser.parse_args()
"ie, the baked script locations may still contain symlinks",
)
args = parser.parse_args()

if " " in os.path.realpath(__file__):
err_str = "\nThe absolute path of install.py cannot contain spaces due to setuptools limitation.\n" \
"Please move installation files to another location or rename offending folder(s).\n"
parser.error(err_str)

# determine install path
if len(args) != 1:
parser.error("expected DEST_DIR")

dest_dir = args[0].format(version=_rez_version)
dest_dir = args.dest_dir.format(version=_rez_version)
dest_dir = os.path.expanduser(dest_dir)
if not opts.keep_symlinks:
if not args.keep_symlinks:
dest_dir = os.path.realpath(dest_dir)

print "installing rez to %s..." % dest_dir
print("installing rez to {}...".format(dest_dir))

# make virtualenv verbose
log_level = Logger.level_for_integer(2 - opts.verbose)
log_level = Logger.level_for_integer(2 - args.verbose)
logger = Logger([(log_level, sys.stdout)])

# create the virtualenv
create_environment(dest_dir)

# install rez from source
_, _, _, venv_bin_dir = path_locations(dest_dir)
py_executable = which("python", env={"PATH":venv_bin_dir,
"PATHEXT":os.environ.get("PATHEXT",
"")})
py_executable = which(
"python",
env={"PATH":venv_bin_dir, "PATHEXT":os.environ.get("PATHEXT", "")},
)
args = [py_executable, "setup.py", "install"]
if opts.verbose:
print "running in %s: %s" % (source_path, " ".join(args))
Expand Down
115 changes: 0 additions & 115 deletions src/build_utils/add_license.py

This file was deleted.

14 changes: 0 additions & 14 deletions src/rez/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,3 @@ def callback(sig, frame):
signal.signal(signal.SIGUSR1, callback) # Register handler


# Copyright 2013-2016 Allan Johns.
#
# This library is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
3 changes: 3 additions & 0 deletions src/rez/_vendor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Vendored dependencies.
"""
File renamed without changes.
File renamed without changes.
Empty file removed src/rez/backport/__init__.py
Empty file.
37 changes: 0 additions & 37 deletions src/rez/backport/importlib.py

This file was deleted.

127 changes: 0 additions & 127 deletions src/rez/backport/ordereddict.py

This file was deleted.

Loading