Skip to content

Commit

Permalink
Try to install conda without conda-incubator/setup-miniconda
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso committed Aug 20, 2023
1 parent 99f5972 commit 2f41c20
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
38 changes: 31 additions & 7 deletions .github/actions/setup-python/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,7 +66,7 @@ runs:
run: |
set -ex
eval "$(conda shell.bash hook)"
source /opt/conda/bin/activate
conda activate python
conda info
Expand All @@ -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
7 changes: 4 additions & 3 deletions .github/workflows/ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit 2f41c20

Please sign in to comment.