From b4b685ed928ab42a580044191a9e906f0f6b16fd Mon Sep 17 00:00:00 2001 From: Jean-Christophe Morin Date: Fri, 22 Sep 2023 17:49:20 -0400 Subject: [PATCH] Fix install script Signed-off-by: Jean-Christophe Morin --- .github/workflows/installation.yaml | 6 +++--- install.py | 10 +++++----- setup.py | 6 ++---- src/rez/cli/_entry_points.py | 1 - 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/installation.yaml b/.github/workflows/installation.yaml index 567a28355a..1d942518c7 100644 --- a/.github/workflows/installation.yaml +++ b/.github/workflows/installation.yaml @@ -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 @@ -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 @@ -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' diff --git a/install.py b/install.py index 7b57a86915..95c7bd65bc 100644 --- a/install.py +++ b/install.py @@ -156,7 +156,7 @@ 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) @@ -164,15 +164,15 @@ def install(dest_dir, print_welcome=False): # 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: diff --git a/setup.py b/setup.py index 71c49e3610..6f2ece0fb8 100644 --- a/setup.py +++ b/setup.py @@ -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) @@ -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) diff --git a/src/rez/cli/_entry_points.py b/src/rez/cli/_entry_points.py index b922ca5589..695a3c8d5f 100644 --- a/src/rez/cli/_entry_points.py +++ b/src/rez/cli/_entry_points.py @@ -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