From 2f41c20001b18d862ab641db311ca6a9ad1866fc Mon Sep 17 00:00:00 2001 From: Jean-Christophe Morin Date: Sun, 20 Aug 2023 17:41:40 -0400 Subject: [PATCH] Try to install conda without conda-incubator/setup-miniconda Signed-off-by: Jean-Christophe Morin --- .github/actions/setup-python/action.yaml | 38 +++++++++++++++++++----- .github/workflows/ubuntu.yaml | 7 +++-- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/.github/actions/setup-python/action.yaml b/.github/actions/setup-python/action.yaml index f37e8d2258..40acf6b613 100644 --- a/.github/actions/setup-python/action.yaml +++ b/.github/actions/setup-python/action.yaml @@ -19,20 +19,44 @@ runs: with: python-version: ${{ inputs.python-version }} - - name: Set up Python ${{ inputs.python-version }} with conda-incubator/setup-miniconda + - name: Set up Python ${{ inputs.python-version }} with conda if: ${{ inputs.python-version == '2.7' }} - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: 3 + shell: bash + run: | + cd /tmp + if [[ "${{ inputs.os }}" = macos* ]]; then + curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o /tmp/miniconda.sh + else + curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o /tmp/miniconda.sh + fi + + case "${{ inputs.os }}" in + macos-*) + curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o /tmp/miniconda.sh + sh /tmp/miniconda.sh -b -p /opt/conda + ;; + ubuntu-*) + curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o /tmp/miniconda.sh + sh /tmp/miniconda.sh -b -p /opt/conda + ls -la /opt/conda + ls -la /opt/conda/bin + ;; + windows-*) + curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -o /c/miniconda.sh + sh /tmp/miniconda.sh -b -p /c/conda + ;; + esac - name: Create conda environment if: ${{ inputs.python-version == '2.7' }} shell: bash run: | + ls -la /opt/conda + ls -la /opt/conda/bin if [[ "${OSTYPE}" == "msys" ]]; then eval "$(/c/Miniconda/condabin/conda.bat shell.bash hook)" else - eval "$(conda shell.bash hook)" + source /opt/conda/bin/activate fi conda create -n python python=2.7 setuptools wheel @@ -42,7 +66,7 @@ runs: run: | set -ex - eval "$(conda shell.bash hook)" + source /opt/conda/bin/activate conda activate python conda info @@ -55,6 +79,6 @@ runs: # Basically, Python provided by conda is "fully portable". Its default # RPATH is "$ORIGIN/../lib". The problem is that once the virtualenv # is created, the copied/symlinked interpreter in the venv won't be - # able to load lib sinec the lib folder isn't copied in the venv. + # able to load lib since the lib folder isn't copied in the venv. patchelf --set-rpath $(dirname $(which python))/../lib $(which python) fi diff --git a/.github/workflows/ubuntu.yaml b/.github/workflows/ubuntu.yaml index 2660595104..e1bf5c736d 100644 --- a/.github/workflows/ubuntu.yaml +++ b/.github/workflows/ubuntu.yaml @@ -69,13 +69,14 @@ jobs: - name: Install Rez run: | + python=$(which python) if [[ "${{ matrix.python-version }}" == "2.7" ]]; then - eval "$(conda shell.bash hook)" + source /opt/conda/bin/activate conda activate python fi mkdir ./installdir - python --version - python ./install.py ./installdir + $python --version + $python ./install.py ./installdir - name: Install Rez test dependencies run: |