Skip to content

Commit

Permalink
MAINT: Fix Azure (mne-tools#11815)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Jul 21, 2023
1 parent 7b23048 commit 57146ee
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 49 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ jobs:
name: Install fonts needed for diagrams
command: |
mkdir -p $HOME/.fonts
echo "Source Code Pro"
curl https://codeload.github.com/adobe-fonts/source-code-pro/tar.gz/2.038R-ro/1.058R-it/1.018R-VAR | tar xz -C $HOME/.fonts
curl https://codeload.github.com/adobe-fonts/source-sans-pro/tar.gz/3.028R | tar xz -C $HOME/.fonts
echo "Source Sans Pro"
curl https://codeload.github.com/adobe-fonts/source-sans/tar.gz/3.028R | tar xz -C $HOME/.fonts
fc-cache -f
# Load pip cache
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
- os: macos-latest
python: '3.8'
kind: mamba
- os: windows-latest
python: '3.10'
kind: mamba
- os: ubuntu-latest
python: '3.8'
kind: minimal
Expand All @@ -82,9 +85,9 @@ jobs:
# Python (if conda)
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ${{ env.CONDA_ACTIVATE_ENV }}
python-version: ${{ env.PYTHON_VERSION }}
environment-file: ${{ env.CONDA_ENV }}
activate-environment: mne
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: ${{ matrix.kind != 'conda' }}
Expand Down
40 changes: 3 additions & 37 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,8 @@ stages:
variables:
MNE_LOGGING_LEVEL: 'warning'
MNE_FORCE_SERIAL: 'true'
OPENBLAS_NUM_THREADS: 1
MKL_NUM_THREADS: 2
OPENBLAS_NUM_THREADS: 2
OMP_DYNAMIC: 'false'
MKL_DYNAMIC: 'false'
PYTHONUNBUFFERED: 1
PYTHONIOENCODING: 'utf-8'
AZURE_CI_WINDOWS: 'true'
Expand All @@ -254,10 +252,6 @@ stages:
strategy:
maxParallel: 4
matrix:
3.10 conda:
PLATFORM: 'x86-64'
TEST_MODE: 'conda'
PYTHON_VERSION: '3.10'
3.9 pip:
TEST_MODE: 'pip'
PYTHON_VERSION: '3.9'
Expand All @@ -270,44 +264,16 @@ stages:
versionSpec: $(PYTHON_VERSION)
architecture: $(PYTHON_ARCH)
addToPath: true
condition: in(variables['TEST_MODE'], 'pip', 'pip-pre')
displayName: 'Get Python'
# https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/anaconda
# https://github.com/MicrosoftDocs/pipelines-anaconda
# https://github.com/ContinuumIO/anaconda-issues/issues/10949
- script: |
echo "##vso[task.prependpath]%CONDA%;%CONDA%\condabin;%CONDA%\Scripts;%CONDA%\Library\bin;%PROGRAMFILES%\Git\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%PROGRAMFILES%\Git\usr\bin"
condition: in(variables['TEST_MODE'], 'conda')
displayName: Add conda to PATH, deal with Qt linking bug
- bash: |
set -e
set -eo pipefail
git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
displayName: Install OpenGL
- bash: |
set -e
./tools/azure_dependencies.sh
condition: in(variables['TEST_MODE'], 'pip', 'pip-pre')
- bash: ./tools/azure_dependencies.sh
displayName: Install dependencies with pip
- script: conda install -c conda-forge "mamba!=1.4.9"
condition: eq(variables['TEST_MODE'], 'conda')
displayName: Get mamba
- script: mamba env update --name base --file environment.yml
condition: eq(variables['TEST_MODE'], 'conda')
displayName: Setup MNE environment
# ipympl is not tested on Windows and even its installation interferes
# with basic matplotlib functionality so it must be uninstalled until fixed
- bash: |
set -e
mamba remove -c conda-forge --force -yq mne ipympl
rm /c/Miniconda/Scripts/mne.exe
condition: eq(variables['TEST_MODE'], 'conda')
displayName: Remove old MNE
- script: pip install -e .
displayName: 'Install MNE-Python dev'
- script: pip install --progress-bar off -e .[test]
condition: eq(variables['TEST_MODE'], 'conda')
displayName: Install testing requirements
- script: mne sys_info -pd
displayName: 'Print config'
- script: python -c "import numpy; numpy.show_config()"
Expand Down
2 changes: 1 addition & 1 deletion tools/azure_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [ "${TEST_MODE}" == "pip" ]; then
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade --only-binary="numba,llvmlite,numpy,scipy,vtk" -r requirements.txt
elif [ "${TEST_MODE}" == "pip-pre" ]; then
python -m pip install --progress-bar off --upgrade pip setuptools wheel packaging
python -m pip install --progress-bar off --upgrade pip setuptools wheel packaging setuptools_scm
python -m pip install --progress-bar off --upgrade --pre --only-binary ":all:" --extra-index-url "https://www.riverbankcomputing.com/pypi/simple" PyQt6 PyQt6-sip PyQt6-Qt6
python -m pip install --progress-bar off --upgrade --pre --only-binary ":all:" --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" numpy scipy statsmodels pandas scikit-learn matplotlib
python -m pip install --progress-bar off --upgrade --pre --only-binary ":all:" --extra-index-url "https://pypi.anaconda.org/scipy-wheels-nightly/simple" dipy
Expand Down
15 changes: 11 additions & 4 deletions tools/github_actions_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ STD_ARGS="--progress-bar off --upgrade"
EXTRA_ARGS=""
if [ ! -z "$CONDA_ENV" ]; then
echo "Uninstalling MNE for CONDA_ENV=${CONDA_ENV}"
pip uninstall -yq mne
conda remove -c conda-forge --force -yq mne
python -m pip uninstall -y mne
elif [ ! -z "$CONDA_DEPENDENCIES" ]; then
echo "Using Mamba to install CONDA_DEPENDENCIES=${CONDA_DEPENDENCIES}"
mamba install -y $CONDA_DEPENDENCIES
Expand Down Expand Up @@ -37,13 +38,19 @@ else
pip install --progress-bar off git+https://github.com/mne-tools/mne-qt-browser
EXTRA_ARGS="--pre"
fi
echo ""

# for compat_minimal and compat_old, we don't want to --upgrade
if [ ! -z "$CONDA_DEPENDENCIES" ]; then
pip install -r requirements_base.txt -r requirements_testing.txt
echo "Installing dependencies for conda"
python -m pip install -r requirements_base.txt -r requirements_testing.txt
else
pip install $STD_ARGS $EXTRA_ARGS -r requirements_base.txt -r requirements_testing.txt -r requirements_hdf5.txt
echo "Installing dependencies using pip"
python -m pip install $STD_ARGS $EXTRA_ARGS -r requirements_base.txt -r requirements_testing.txt -r requirements_hdf5.txt
fi
echo ""

if [ "${DEPS}" != "minimal" ]; then
pip install $STD_ARGS $EXTRA_ARGS -r requirements_testing_extra.txt
echo "Installing non-minimal dependencies"
python -m pip install $STD_ARGS $EXTRA_ARGS -r requirements_testing_extra.txt
fi
4 changes: 0 additions & 4 deletions tools/github_actions_env_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,19 @@ set -eo pipefail -x
# old and minimal use conda
if [[ "$MNE_CI_KIND" == "old" ]]; then
echo "Setting conda env vars for old"
echo "CONDA_ACTIVATE_ENV=true" >> $GITHUB_ENV
echo "CONDA_DEPENDENCIES=numpy=1.20.2 scipy=1.6.3 matplotlib=3.4 pandas=1.2.4 scikit-learn=0.24.2" >> $GITHUB_ENV
echo "MNE_IGNORE_WARNINGS_IN_TESTS=true" >> $GITHUB_ENV
echo "MNE_SKIP_NETWORK_TESTS=1" >> $GITHUB_ENV
elif [[ "$MNE_CI_KIND" == "minimal" ]]; then
echo "Setting conda env vars for minimal"
echo "CONDA_ACTIVATE_ENV=true" >> $GITHUB_ENV
echo "CONDA_DEPENDENCIES=numpy scipy matplotlib" >> $GITHUB_ENV
elif [[ "$MNE_CI_KIND" == "notebook" ]]; then
echo "CONDA_ENV=environment.yml" >> $GITHUB_ENV
echo "CONDA_ACTIVATE_ENV=mne" >> $GITHUB_ENV
# TODO: This should work but breaks stuff...
# echo "MNE_3D_BACKEND=notebook" >> $GITHUB_ENV
elif [[ "$MNE_CI_KIND" != "pip"* ]]; then # conda, mamba (use warning level for completeness)
echo "Setting conda env vars for $MNE_CI_KIND"
echo "CONDA_ENV=environment.yml" >> $GITHUB_ENV
echo "CONDA_ACTIVATE_ENV=mne" >> $GITHUB_ENV
echo "MNE_QT_BACKEND=PyQt5" >> $GITHUB_ENV
echo "MNE_LOGGING_LEVEL=warning" >> $GITHUB_ENV
else # pip-like
Expand Down
2 changes: 1 addition & 1 deletion tools/github_actions_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eo pipefail

if [[ "${CI_OS_NAME}" != "macos"* ]]; then
if [[ "${CI_OS_NAME}" == "ubuntu"* ]]; then
if [[ "${MNE_CI_KIND}" == "pip-pre" ]]; then
CONDITION="not (slowtest or pgtest)"
else
Expand Down

0 comments on commit 57146ee

Please sign in to comment.