From 1f3ba871bcc1e403a4df2ff1ecaf10f95075aad1 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Sat, 15 Feb 2020 09:32:00 -0500 Subject: [PATCH] Use conda for macOS jobs The pip installable numpy is causing segfaults on catalina and mojave environments. To workaround this issue this commit switches to using a conda install for the macos jobs only. --- azure-pipelines.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e3004194fad5..978d0747a5fa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -234,8 +234,17 @@ stages: inputs: versionSpec: '$(python.version)' displayName: 'Use Python $(python.version)' + - bash: echo "##vso[task.prependpath]$CONDA/bin" + displayName: Add conda to PATH + - bash: sudo chown -R $USER $CONDA + displayName: Take ownership of conda installation + - script: conda create --yes --quiet --name qiskit-terra python=$(python.version) + displayName: Create Anaconda environment - bash: | set -e + source activate qiskit-terra + conda update --yes -n base conda + conda install --yes --quiet --name qiskit-terra python=$(python.version) numpy python -m pip install --upgrade pip pip install -U -r requirements.txt -r requirements-dev.txt -c constraints.txt pip install -c constraints.txt -e . @@ -244,6 +253,7 @@ stages: displayName: 'Install dependencies' - bash: | set -e + source activate qiskit-terra export PYTHONHASHSEED=$(python -S -c "import random; print(random.randint(1, 4294967295))") echo "PYTHONHASHSEED=$PYTHONHASHSEED" stestr run @@ -262,6 +272,7 @@ stages: artifactName: 'drop_macos' - bash: | set -e + source activate qiskit-terra pip install -U junitxml mkdir -p junit stestr last --subunit | tools/subunit_to_junit.py -o junit/test-results.xml @@ -402,8 +413,17 @@ stages: inputs: versionSpec: '$(python.version)' displayName: 'Use Python $(python.version)' + - bash: echo "##vso[task.prependpath]$CONDA/bin" + displayName: Add conda to PATH + - bash: sudo chown -R $USER $CONDA + displayName: Take ownership of conda installation + - script: conda create --yes --quiet --name qiskit-terra python=$(python.version) + displayName: Create Anaconda environment - bash: | set -e + source activate qiskit-terra + conda update --yes -n base conda + conda install --yes --quiet --name qiskit-terra python=$(python.version) numpy python -m pip install --upgrade pip pip install -U -r requirements.txt -r requirements-dev.txt -c constraints.txt pip install -c constraints.txt -e . @@ -412,6 +432,7 @@ stages: displayName: 'Install dependencies' - bash: | set -e + source activate qiskit-terra export PYTHONHASHSEED=$(python -S -c "import random; print(random.randint(1, 4294967295))") echo "PYTHONHASHSEED=$PYTHONHASHSEED" stestr run --concurrency 2 @@ -430,6 +451,7 @@ stages: artifactName: 'drop_macos' - bash: | set -e + source activate qiskit-terra pip install -U junitxml mkdir -p junit stestr last --subunit | tools/subunit_to_junit.py -o junit/test-results.xml