Skip to content

Commit

Permalink
Fix install script
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso committed Sep 22, 2023
1 parent 68b546e commit b4b685e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/installation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- os: ubuntu-latest
method: pip
REZ_SET_PATH_COMMAND: 'export PATH=${PATH}:/opt/rez/bin PYTHONPATH=${PYTHONPATH}:/opt/rez'
REZ_SET_PATH_COMMAND: 'export PATH=${PATH}:/opt/rez/bin/rez PYTHONPATH=${PYTHONPATH}:/opt/rez'
REZ_INSTALL_COMMAND: |
set -ex
if [[ "${MATRIX_PYTHON_VERSION}" == "2.7" ]]; then
Expand All @@ -74,7 +74,7 @@ jobs:
python ./install.py ~/rez
- os: macos-latest
method: pip
REZ_SET_PATH_COMMAND: 'export PATH="$PATH:~/rez/bin" PYTHONPATH=$PYTHONPATH:$HOME/rez'
REZ_SET_PATH_COMMAND: 'export PATH="$PATH:~/rez/bin/rez" PYTHONPATH=$PYTHONPATH:$HOME/rez'
REZ_INSTALL_COMMAND: |
set -ex
if [[ "${MATRIX_PYTHON_VERSION}" == "2.7" ]]; then
Expand All @@ -94,7 +94,7 @@ jobs:
python ./install.py C:\ProgramData\rez
- os: windows-2019
method: pip
REZ_SET_PATH_COMMAND: '[System.Environment]::SetEnvironmentVariable("PATH","$env:PATH;C:\ProgramData\rez\bin"); $env:PYTHONPATH="$env:PYTHONPATH;C:\ProgramData\rez"'
REZ_SET_PATH_COMMAND: '[System.Environment]::SetEnvironmentVariable("PATH","$env:PATH;C:\ProgramData\rez\bin\rez"); $env:PYTHONPATH="$env:PYTHONPATH;C:\ProgramData\rez"'
REZ_INSTALL_COMMAND: |
if ($env:MATRIX_PYTHON_VERSION -eq "2.7") {
& 'C:\Miniconda\shell\condabin\conda-hook.ps1'
Expand Down
10 changes: 5 additions & 5 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,23 @@ def install(dest_dir, print_welcome=False):
install_rez_from_source(dest_dir)

# patch the rez binaries
patch_rez_binaries(dest_dir)
# patch_rez_binaries(dest_dir)

# copy completion scripts into virtualenv
completion_path = copy_completion_scripts(dest_dir)

# mark virtualenv as production rez install. Do not remove - rez uses this!
virtualenv_bin_dir = get_virtualenv_bin_dir(dest_dir)
dest_bin_dir = os.path.join(virtualenv_bin_dir, "rez")
validation_file = os.path.join(dest_bin_dir, ".rez_production_install")
with open(validation_file, 'w') as f:
f.write(_rez_version)
# validation_file = os.path.join(dest_bin_dir, ".rez_production_install")
# with open(validation_file, 'w') as f:
# f.write(_rez_version)

# done
if print_welcome:
print()
print("SUCCESS!")
rez_exe = os.path.realpath(os.path.join(dest_bin_dir, "rez"))
rez_exe = os.path.realpath(os.path.join(dest_bin_dir))
print("Rez executable installed to: %s" % rez_exe)

try:
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ def find_files(pattern, path=None, root="rez"):
# Note that this is not done on Windows because the Windows launcher
# already does this.
if not sys.flags.ignore_environment and platform.system() != 'Windows':
args = sys.orig_argv[:]
args[0] = sys.executable
args.insert(1, '-E')
args = [sys.executable, '-E'] + sys.argv
if os.getenv('REZ_LAUNCHER_DEBUG'):
print('Launching:', ' '.join(args))
os.execvp(sys.executable, args)
Expand Down Expand Up @@ -120,7 +118,7 @@ def run(self):

prod_install_path = os.path.join(tmpdir, ".rez_production_install")
with open(prod_install_path, "w") as fd:
fd.write("# Production install installed with pip")
fd.write(_rez_version)

scripts.append(prod_install_path)

Expand Down
1 change: 0 additions & 1 deletion src/rez/cli/_entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def check_production_install():
@register("jctest")
def run_jctest():
print("argv:", sys.argv)
print("orig_argv", sys.orig_argv)
print("executable:", sys.executable)
print("sys.flags:", sys.flags)
return 0
Expand Down

0 comments on commit b4b685e

Please sign in to comment.