diff --git a/.github/workflows/codespell_and_flake.yml b/.github/workflows/codespell_and_flake.yml new file mode 100644 index 00000000000..d3a38a82ac0 --- /dev/null +++ b/.github/workflows/codespell_and_flake.yml @@ -0,0 +1,38 @@ +name: 'codespell_and_flake' +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + style: + if: "github.repository == 'mne-tools/mne-python' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')" + runs-on: ubuntu-latest + env: + CODESPELL_DIRS: 'mne/ doc/ tutorials/ examples/' + CODESPELL_SKIPS: 'doc/auto_*,*.fif,*.eve,*.gz,*.tgz,*.zip,*.mat,*.stc,*.label,*.w,*.bz2,*.annot,*.sulc,*.log,*.local-copy,*.orig_avg,*.inflated_avg,*.gii,*.pyc,*.doctree,*.pickle,*.inv,*.png,*.edf,*.touch,*.thickness,*.nofix,*.volume,*.defect_borders,*.mgh,lh.*,rh.*,COR-*,FreeSurferColorLUT.txt,*.examples,.xdebug_mris_calc,bad.segments,BadChannels,*.hist,empty_file,*.orig,*.js,*.map,*.ipynb,searchindex.dat,install_mne_c.rst,plot_*.rst,*.rst.txt,c_EULA.rst*,*.html,gdf_encodes.txt,*.svg' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.8' + architecture: 'x64' + - run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install flake8 + name: 'Install dependencies' + - uses: rbialon/flake8-annotations@v1 + name: 'Setup flake8 annotations' + - run: make flake + name: 'Run flake8' + - uses: GuillaumeFavelier/actions-codespell@feat/quiet_level + with: + path: ${{ env.CODESPELL_DIRS }} + skip: ${{ env.CODESPELL_SKIPS }} + quiet_level: '3' + builtin: 'clear,rare,informal,names' + ignore_words_file: 'ignore_words.txt' + name: 'Run codespell' diff --git a/.github/workflows/compat_minimal.yml b/.github/workflows/compat_minimal.yml new file mode 100644 index 00000000000..8e7eafc5c29 --- /dev/null +++ b/.github/workflows/compat_minimal.yml @@ -0,0 +1,65 @@ +name: 'compat / minimal' +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + # Minimal (runs with and without testing data) + job: + if: "github.repository == 'mne-tools/mne-python' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')" + name: 'py3.7' + runs-on: ubuntu-latest + defaults: + run: + shell: bash + env: + CONDA_DEPENDENCIES: 'numpy scipy matplotlib' + DEPS: 'minimal' + DISPLAY: ':99.0' + MNE_DONTWRITE_HOME: true + MNE_FORCE_SERIAL: true + MNE_LOGGING_LEVEL: 'warning' + MNE_SKIP_NETWORK_TEST: 1 + MNE_SKIP_TESTING_DATASET_TESTS: true + OPENBLAS_NUM_THREADS: '1' + PYTHONUNBUFFERED: '1' + PYTHON_VERSION: '3.7' + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: | + sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libopengl0 + /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset; + name: 'Setup xvfb' + - uses: conda-incubator/setup-miniconda@v2 + with: + python-version: ${{ env.PYTHON_VERSION }} + name: 'Setup conda' + - shell: bash -el {0} + run: | + ./tools/github_actions_dependencies.sh + source tools/get_minimal_commands.sh + name: 'Install dependencies' + - shell: bash -el {0} + run: ./tools/github_actions_install.sh + name: 'Install MNE' + - shell: bash -el {0} + run: ./tools/github_actions_infos.sh + name: 'Show infos' + - shell: bash -el {0} + run: ./tools/github_actions_download.sh + name: 'Download testing data' + - shell: bash -el {0} + run: ./tools/github_actions_locale.sh + name: 'Print locale' + - shell: bash -el {0} + run: ./tools/github_actions_test.sh + name: 'Run tests' + - uses: codecov/codecov-action@v1 + if: success() + name: 'Upload coverage to CodeCov' diff --git a/.github/workflows/compat_old.yml b/.github/workflows/compat_old.yml new file mode 100644 index 00000000000..04cbf08d00d --- /dev/null +++ b/.github/workflows/compat_old.yml @@ -0,0 +1,60 @@ +name: 'compat / old' +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + # Old dependencies + job: + if: "github.repository == 'mne-tools/mne-python' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')" + name: 'py3.6' + runs-on: ubuntu-latest + defaults: + run: + shell: bash + env: + CONDA_DEPENDENCIES: 'numpy=1.15.4 scipy=1.1 matplotlib=3.0.3 pandas=0.23.4 scikit-learn=0.20.2' + DISPLAY: ':99.0' + MNE_LOGGING_LEVEL: 'warning' + OPENBLAS_NUM_THREADS: '1' + PYTHONUNBUFFERED: '1' + PYTHON_VERSION: '3.6' + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: | + sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libopengl0 + /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset; + name: 'Setup xvfb' + - uses: conda-incubator/setup-miniconda@v2 + with: + python-version: ${{ env.PYTHON_VERSION }} + name: 'Setup conda' + - shell: bash -el {0} + run: | + ./tools/github_actions_dependencies.sh + source tools/get_minimal_commands.sh + name: 'Install dependencies' + - shell: bash -el {0} + run: ./tools/github_actions_install.sh + name: 'Install MNE' + - shell: bash -el {0} + run: ./tools/github_actions_infos.sh + name: 'Show infos' + - shell: bash -el {0} + run: ./tools/github_actions_download.sh + name: 'Download testing data' + - shell: bash -el {0} + run: ./tools/github_actions_locale.sh + name: 'Print locale' + - shell: bash -el {0} + run: ./tools/github_actions_test.sh + name: 'Run tests' + - uses: codecov/codecov-action@v1 + if: success() + name: 'Upload coverage to CodeCov' diff --git a/.github/workflows/linux.yml b/.github/workflows/linux_conda.yml similarity index 97% rename from .github/workflows/linux.yml rename to .github/workflows/linux_conda.yml index f89046655fd..3123aa67d8c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux_conda.yml @@ -1,4 +1,4 @@ -name: 'Linux' +name: 'linux / conda' on: push: branches: @@ -8,20 +8,21 @@ on: - '*' jobs: - Conda: + # Linux + job: if: "github.repository == 'mne-tools/mne-python' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')" + name: 'py3.8' runs-on: ubuntu-latest defaults: run: shell: bash env: + CONDA_ENV: 'environment.yml' DISPLAY: ':99.0' - PYTHON_VERSION: '3.8' MNE_LOGGING_LEVEL: 'warning' OPENBLAS_NUM_THREADS: '1' PYTHONUNBUFFERED: '1' - CONDA_ENV: 'environment.yml' - TRAVIS_OS_NAME: 'linux' + PYTHON_VERSION: '3.8' steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/linux_pip.yml b/.github/workflows/linux_pip.yml new file mode 100644 index 00000000000..f35345c5a02 --- /dev/null +++ b/.github/workflows/linux_pip.yml @@ -0,0 +1,60 @@ +name: 'linux / pip' +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + # PIP + non-default stim channel + log level info + job: + if: "github.repository == 'mne-tools/mne-python' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')" + name: 'py3.8' + runs-on: ubuntu-latest + defaults: + run: + shell: bash + env: + DISPLAY: ':99.0' + MNE_LOGGING_LEVEL: 'info' + MNE_STIM_CHANNEL: 'STI101' + OPENBLAS_NUM_THREADS: '1' + PYTHONUNBUFFERED: '1' + PYTHON_VERSION: '3.8' + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: | + sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libopengl0 + /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset; + name: 'Setup xvfb' + - uses: actions/setup-python@v2 + with: + python-version: ${{ env.PYTHON_VERSION }} + name: 'Setup python' + - shell: bash -el {0} + run: | + ./tools/github_actions_dependencies.sh + source tools/get_minimal_commands.sh + name: 'Install dependencies' + - shell: bash -el {0} + run: ./tools/github_actions_install.sh + name: 'Install MNE' + - shell: bash -el {0} + run: ./tools/github_actions_infos.sh + name: 'Show infos' + - shell: bash -el {0} + run: ./tools/github_actions_download.sh + name: 'Download testing data' + - shell: bash -el {0} + run: ./tools/github_actions_locale.sh + name: 'Print locale' + - shell: bash -el {0} + run: ./tools/github_actions_test.sh + name: 'Run tests' + - uses: codecov/codecov-action@v1 + if: success() + name: 'Upload coverage to CodeCov' diff --git a/.github/workflows/macos.yml b/.github/workflows/macos_conda.yml similarity index 95% rename from .github/workflows/macos.yml rename to .github/workflows/macos_conda.yml index 6e9a1bc4893..1006d1ee3f6 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos_conda.yml @@ -1,4 +1,4 @@ -name: 'MacOS' +name: 'macos / conda' on: push: branches: @@ -8,8 +8,9 @@ on: - '*' jobs: - Conda: + job: if: "github.repository == 'mne-tools/mne-python' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')" + name: 'py3.8' runs-on: macos-latest defaults: run: @@ -20,7 +21,7 @@ jobs: OPENBLAS_NUM_THREADS: '1' PYTHONUNBUFFERED: '1' CONDA_ENV: 'environment.yml' - TRAVIS_OS_NAME: 'osx' + CI_OS_NAME: 'osx' steps: - uses: actions/checkout@v2 with: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7bd217ec438..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,135 +0,0 @@ -language: generic -dist: bionic -cache: - pip: true -addons: - apt: - packages: - - libxkbcommon-x11-0 - - libxcb* - - libosmesa6 - - libglx-mesa0 - - libopengl0 - - libglx0 - - libdbus-1-3 -env: - # OPENBLAS_NUM_THREADS=1 avoid slowdowns: - # https://github.com/xianyi/OpenBLAS/issues/731 - global: PYTHON_VERSION=3.7 DISPLAY=:99.0 MNE_LOGGING_LEVEL=warning - CONDA_VERSION=">=4.3.27" OPENBLAS_NUM_THREADS=1 PYTHONUNBUFFERED=1 - -matrix: - include: - # PIP + non-default stim channel + log level info - - os: linux - env: MNE_STIM_CHANNEL=STI101 MNE_LOGGING_LEVEL=info - language: python - python: "3.8" - - # Old dependencies - - os: linux - env: PYTHON_VERSION=3.6 - CONDA_DEPENDENCIES="numpy=1.15.4 scipy=1.1 matplotlib=3.0.3 pandas=0.23.4 scikit-learn=0.20.2" - - # Minimal (runs with and without testing data) - - os: linux - env: DEPS=minimal - CONDA_DEPENDENCIES="numpy scipy matplotlib" - MNE_DONTWRITE_HOME=true MNE_FORCE_SERIAL=true MNE_SKIP_NETWORK_TEST=1 MNE_SKIP_TESTING_DATASET_TESTS=true - -# Setup anaconda -before_install: - - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset; - - | - if [ -z "$CONDA_DEPENDENCIES" ]; then - pip uninstall -yq numpy - pip install -i "https://pypi.anaconda.org/scipy-wheels-nightly/simple" --pre "numpy!=1.20.0.dev0+20201111233731.0ffaaf8,!=1.20.0.dev0+20201111232921.0ffaaf8" - pip install -f "https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com" scipy pandas scikit-learn matplotlib h5py Pillow - pip install https://github.com/pyvista/pyvista/zipball/master - pip install https://github.com/pyvista/pyvistaqt/zipball/master - pip install --upgrade -r requirements.txt - else - git clone https://github.com/astropy/ci-helpers.git - source ci-helpers/travis/setup_conda.sh - fi - # Always install these via pip so we get the latest possible versions (testing bugfixes) - - pip install --upgrade -r requirements_testing.txt codecov - - if [ "${DEPS}" != "minimal" ]; then - pip install nitime; - fi - # Don't source mne_setup_sh here because changing PATH etc. can't be done in a script - - if [ "${DEPS}" != "minimal" ]; then - source tools/get_minimal_commands.sh; - fi; - -install: - # Suppress the parallel outputs for logging cleanliness - - python setup.py build - - python setup.py install - - mne sys_info - - python -c "import numpy; numpy.show_config()" - - SRC_DIR=$(pwd) - - cd ~ - # Trigger download of testing data - - if [ "${DEPS}" != "minimal" ]; then - python -c 'import mne; mne.datasets.testing.data_path(verbose=True)'; - fi; - - cd ${SRC_DIR} - - -script: - - echo "Print locale " - - locale - - echo "Other stuff" - # OSX runs ~2x slower than Linux on Travis, so skip any slow ones there - # Until https://github.com/numpy/numpy/issues/15580 is resolved we also - # need the --pre wheels to skip slow ones. - - CONDITION='not ultraslowtest'; - # Determine directories to test (could use SPLIT=0 SPLIT=1 but currently - # we are fast enough, so disable it) - - if [ -z ${SPLIT} ]; then - USE_DIRS="mne/"; - else - if [ "${SPLIT}" == "0" ]; then - MNE_DIRS=". beamformer channels commands connectivity datasets decoding forward gui inverse_sparse io"; - elif [ "${SPLIT}" == "1" ]; then - MNE_DIRS="minimum_norm preprocessing realtime simulation stats time_frequency viz"; - elif [ "${SPLIT}" == "2" ]; then - MNE_DIRS="."; - else - MNE_DIRS="beamformer channels commands connectivity datasets decoding forward gui inverse_sparse io"; - fi; - USE_DIRS=""; - for DIR in ${MNE_DIRS}; do - if [ "${DIR}" == "." ]; then - USE_DIRS="mne/tests mne/*.py ${USE_DIRS}"; - else - USE_DIRS="mne/${DIR}/ ${USE_DIRS}"; - fi; - done; - fi; - # Remove numpydoc tests on older Python (builtin docstrings not as good) - - if [ "${PYTHON_VERSION}" == "3.6" ]; then - pip uninstall -yq numpydoc; - fi; - # Test run_tests_if_main - - if [ "${DEPS}" == "minimal" ]; then - pip uninstall -yq mne; - pip install -e .; - python mne/tests/test_evoked.py; - fi; - - echo 'pytest -m "${CONDITION}" --tb=short --cov=mne -vv ${USE_DIRS}' - - pytest -m "${CONDITION}" --tb=short --cov=mne -vv ${USE_DIRS} - # run the minimal one with the testing data as well - - if [ "${DEPS}" == "minimal" ]; then - export MNE_SKIP_TESTING_DATASET_TESTS=false; - python -c 'import mne; mne.datasets.testing.data_path(verbose=True)'; - fi; - - if [ "${DEPS}" == "minimal" ]; then - pytest -m "${CONDITION}" --tb=short --cov=mne -vv ${USE_DIRS}; - fi; - -after_script: - # Need to run from source dir to exectue "git" commands - - cd ${SRC_DIR}; - - codecov; diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 47cb785cb86..8c06ca8ac03 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,240 +10,254 @@ pr: include: - '*' # must quote since "*" is a YAML reserved character; we want a string -jobs: -- job: Style - pool: - vmImage: 'ubuntu-18.04' - variables: - PYTHON_VERSION: '3.8' - PYTHON_ARCH: 'x64' - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: $(PYTHON_VERSION) - architecture: $(PYTHON_ARCH) - addToPath: true - displayName: 'Get Python' - - bash: | - set -e - python -m pip install --upgrade pip setuptools - python -m pip install numpy scipy matplotlib -r requirements_testing.txt - displayName: Install dependencies - condition: always() - - bash: | - make flake - displayName: make flake - condition: always() - - bash: | - make pydocstyle - displayName: make pydocstyle - condition: always() - - bash: | - make codespell-error - displayName: make codespell-error - condition: always() - - bash: | - make docstring - displayName: make docstring - - bash: | - make nesting - displayName: make nesting - condition: always() - - bash: | - make check-manifest - displayName: make check-manifest - condition: always() - - bash: | - make check-readme - displayName: make check-readme - condition: always() +stages: +- stage: Check + jobs: + - job: Skip + pool: + vmImage: 'ubuntu-18.04' + variables: + RET: 'true' + steps: + - bash: | + git_log=`git log --max-count=1 --skip=1 --pretty=format:"%s"` + echo "##vso[task.setvariable variable=log]$git_log" + - bash: echo "##vso[task.setvariable variable=RET]false" + condition: or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]')) + - bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET" + name: result -- job: Ultraslow - pool: - vmImage: 'ubuntu-18.04' - variables: - DISPLAY: ':99' - OPENBLAS_NUM_THREADS: '1' - steps: - - bash: | - sudo apt install libxkbcommon-x11-0 xvfb tcsh libxcb* - displayName: 'Install Ubuntu dependencies' - - bash: | - source tools/get_minimal_commands.sh - echo "##vso[task.setvariable variable=MNE_ROOT]${MNE_ROOT}" - echo "##vso[task.setvariable variable=PATH]${PATH}" - echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]${LD_LIBRARY_PATH}" - echo "##vso[task.setvariable variable=NEUROMAG2FT_ROOT]${NEUROMAG2FT_ROOT}" - echo "##vso[task.setvariable variable=FREESURFER_HOME]${FREESURFER_HOME}" - echo "##vso[task.setvariable variable=MNE_SKIP_FS_FLASH_CALL]${MNE_SKIP_FS_FLASH_CALL}" - displayName: 'Install minimal commands' - - bash: | - echo $PATH - mne_surf2bem --version - fsl_rigid_register --version - displayName: 'Test minimal commands' - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.7' - architecture: 'x64' - addToPath: true - displayName: 'Get Python' - - bash: | - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset; - displayName: 'Spin up Xvfb' - - bash: | - set -e - python -m pip install --upgrade pip setuptools - python -m pip install --upgrade numpy scipy vtk -r requirements.txt -r requirements_testing.txt codecov - displayName: 'Install dependencies with pip' - - script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" - displayName: 'Get test data' - - script: pytest -m "ultraslowtest" --tb=short --cov=mne -vv mne - displayName: 'Run ultraslow tests' - - script: codecov --root $BUILD_REPOSITORY_LOCALPATH -t $CODECOV_TOKEN - displayName: 'Codecov' - env: - CODECOV_TOKEN: $(CODECOV_TOKEN) - condition: succeededOrFailed() - - task: PublishTestResults@2 - inputs: - testResultsFiles: 'junit-*.xml' - testRunTitle: 'Publish test results for $(Agent.JobName)' - failTaskOnFailedTests: true - condition: succeededOrFailed() +- stage: Main + condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) + dependsOn: Check + jobs: + - job: Style + pool: + vmImage: 'ubuntu-18.04' + variables: + PYTHON_VERSION: '3.8' + PYTHON_ARCH: 'x64' + steps: + - bash: echo $(COMMIT_MSG) + - task: UsePythonVersion@0 + inputs: + versionSpec: $(PYTHON_VERSION) + architecture: $(PYTHON_ARCH) + addToPath: true + displayName: 'Get Python' + - bash: | + set -e + python -m pip install --upgrade pip setuptools + python -m pip install numpy scipy matplotlib -r requirements_testing.txt + displayName: Install dependencies + condition: always() + - bash: | + make pydocstyle + displayName: make pydocstyle + condition: always() + - bash: | + make docstring + displayName: make docstring + - bash: | + make nesting + displayName: make nesting + condition: always() + - bash: | + make check-manifest + displayName: make check-manifest + condition: always() + - bash: | + make check-readme + displayName: make check-readme + condition: always() -- job: Notebook - pool: - vmImage: 'ubuntu-18.04' - steps: - - bash: | - set -e - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh --progress=dot:mega - bash miniconda.sh -b -p ~/miniconda - source ~/miniconda/etc/profile.d/conda.sh - conda activate base - conda env update --file server_environment.yml - pip uninstall -yq mne - pip install -ve . - pip install pytest pytest-cov pytest-timeout pytest-sugar pytest-xdist flake8 codecov - echo "##vso[task.setvariable variable=PATH]${PATH}" - echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]${LD_LIBRARY_PATH}" - displayName: 'Install dependencies' - - script: mne sys_info - displayName: 'Print config and test access to commands' - - script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" - displayName: 'Get test data' - - script: pytest --tb=short --cov=mne -vv mne/viz - displayName: 'Run viz tests' - - script: codecov --root $BUILD_REPOSITORY_LOCALPATH -t $CODECOV_TOKEN - displayName: 'Codecov' - env: - CODECOV_TOKEN: $(CODECOV_TOKEN) - condition: succeededOrFailed() - - task: PublishTestResults@2 - inputs: - testResultsFiles: 'junit-*.xml' - testRunTitle: 'Publish test results for $(Agent.JobName)' - failTaskOnFailedTests: true - condition: succeededOrFailed() + - job: Ultraslow + pool: + vmImage: 'ubuntu-18.04' + variables: + DISPLAY: ':99' + OPENBLAS_NUM_THREADS: '1' + steps: + - bash: | + sudo apt install libxkbcommon-x11-0 xvfb tcsh libxcb* + displayName: 'Install Ubuntu dependencies' + - bash: | + source tools/get_minimal_commands.sh + echo "##vso[task.setvariable variable=MNE_ROOT]${MNE_ROOT}" + echo "##vso[task.setvariable variable=PATH]${PATH}" + echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]${LD_LIBRARY_PATH}" + echo "##vso[task.setvariable variable=NEUROMAG2FT_ROOT]${NEUROMAG2FT_ROOT}" + echo "##vso[task.setvariable variable=FREESURFER_HOME]${FREESURFER_HOME}" + echo "##vso[task.setvariable variable=MNE_SKIP_FS_FLASH_CALL]${MNE_SKIP_FS_FLASH_CALL}" + displayName: 'Install minimal commands' + - bash: | + echo $PATH + mne_surf2bem --version + fsl_rigid_register --version + displayName: 'Test minimal commands' + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: 'x64' + addToPath: true + displayName: 'Get Python' + - bash: | + /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset; + displayName: 'Spin up Xvfb' + - bash: | + set -e + python -m pip install --upgrade pip setuptools + python -m pip install --upgrade numpy scipy vtk -r requirements.txt -r requirements_testing.txt codecov + displayName: 'Install dependencies with pip' + - script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" + displayName: 'Get test data' + - script: pytest -m "ultraslowtest" --tb=short --cov=mne -vv mne + displayName: 'Run ultraslow tests' + - script: codecov --root $BUILD_REPOSITORY_LOCALPATH -t $CODECOV_TOKEN + displayName: 'Codecov' + env: + CODECOV_TOKEN: $(CODECOV_TOKEN) + condition: succeededOrFailed() + - task: PublishTestResults@2 + inputs: + testResultsFiles: 'junit-*.xml' + testRunTitle: 'Publish test results for $(Agent.JobName)' + failTaskOnFailedTests: true + condition: succeededOrFailed() -- job: Windows - pool: - vmImage: 'VS2017-Win2016' - variables: - MNE_LOGGING_LEVEL: 'warning' - MNE_FORCE_SERIAL: 'true' - OPENBLAS_NUM_THREADS: 1 - PYTHONUNBUFFERED: 1 - PYTHONIOENCODING: 'utf-8' - MKL_NUM_THREADS: 1 - AZURE_CI_WINDOWS: 'true' - PYTHON_ARCH: 'x64' - strategy: - maxParallel: 4 - matrix: - 3.7 conda: - PLATFORM: 'x86-64' - TEST_MODE: 'conda' - PYTHON_VERSION: '3.8' - 3.7 pip: - TEST_MODE: 'pip' - PYTHON_VERSION: '3.7' - 3.8 pip pre: - TEST_MODE: 'pre-pip' - PYTHON_VERSION: '3.8' - OPENBLAS_CORETYPE: 'prescott' # workaround for https://github.com/numpy/numpy/issues/16913 - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: $(PYTHON_VERSION) - architecture: $(PYTHON_ARCH) - addToPath: true - condition: in(variables['TEST_MODE'], 'pip', 'pre-pip') - displayName: 'Get Python' - # https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/anaconda - # https://github.com/MicrosoftDocs/pipelines-anaconda - # Qt 5.9 post-link failure: - # https://github.com/ContinuumIO/anaconda-issues/issues/10949 - - script: echo "##vso[task.prependpath]%CONDA%;%CONDA%\condabin;%CONDA%\Scripts;%CONDA%\Library\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;" - condition: in(variables['TEST_MODE'], 'conda') - displayName: Add conda to PATH, deal with Qt 5.9 bug - - bash: | - set -e - git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git - powershell gl-ci-helpers/appveyor/install_opengl.ps1 - displayName: Install OpenGL - - bash: | - set -e - python -m pip install --upgrade pip "setuptools<50.0" - python -m pip install --upgrade numpy scipy vtk - python -m pip install --upgrade -r requirements.txt -r requirements_testing.txt - python -m pip install codecov - condition: eq(variables['TEST_MODE'], 'pip') - displayName: 'Install dependencies with pip' - - bash: | - set -e - python -m pip install --upgrade pip "setuptools<50.0" - python -m pip install --upgrade --pre --only-binary ":all:" -i "https://pypi.anaconda.org/scipy-wheels-nightly/simple" "numpy!=1.20.0.dev0+20201111233731.0ffaaf8,!=1.20.0.dev0+20201111232921.0ffaaf8" - python -m pip install --upgrade --pre --only-binary ":all:" -f "https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com" scipy pandas scikit-learn matplotlib h5py Pillow - python -m pip install --upgrade --only-binary vtk vtk; - python -m pip install https://github.com/pyvista/pyvista/zipball/master - python -m pip install https://github.com/pyvista/pyvistaqt/zipball/master - python -m pip install -r requirements.txt -r requirements_testing.txt codecov - condition: eq(variables['TEST_MODE'], 'pre-pip') - displayName: 'Install dependencies with pip --pre' - - powershell: | - Set-StrictMode -Version Latest - $ErrorActionPreference = "Stop" - $PSDefaultParameterValues['*:ErrorAction']='Stop' - conda update -n base -c defaults conda - conda env update --name base --file environment.yml - pip uninstall -yq mne - pip install -r requirements_testing.txt codecov - condition: eq(variables['TEST_MODE'], 'conda') - displayName: 'Install dependencies with conda' - - script: python setup.py develop - displayName: 'Install MNE-Python dev' - - script: mne sys_info - displayName: 'Print config and test access to commands' - - script: python -c "import numpy; numpy.show_config()" - displayName: Print NumPy config - - script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" - displayName: 'Get test data' - - script: pytest -m "not slowtest" --tb=short --cov=mne -vv mne - displayName: 'Run tests' - - script: codecov --root %BUILD_REPOSITORY_LOCALPATH% -t %CODECOV_TOKEN% - displayName: 'Codecov' - env: - CODECOV_TOKEN: $(CODECOV_TOKEN) - condition: succeededOrFailed() - - task: PublishTestResults@2 - inputs: - testResultsFiles: 'junit-*.xml' - testRunTitle: 'Publish test results for $(Agent.JobName) $(TEST_MODE) $(PYTHON_VERSION)' - failTaskOnFailedTests: true - condition: succeededOrFailed() + - job: Notebook + pool: + vmImage: 'ubuntu-18.04' + steps: + - bash: | + set -e + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh --progress=dot:mega + bash miniconda.sh -b -p ~/miniconda + source ~/miniconda/etc/profile.d/conda.sh + conda activate base + conda env update --file server_environment.yml + pip uninstall -yq mne + pip install -ve . + pip install pytest pytest-cov pytest-timeout pytest-sugar pytest-xdist flake8 codecov + echo "##vso[task.setvariable variable=PATH]${PATH}" + echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]${LD_LIBRARY_PATH}" + displayName: 'Install dependencies' + - script: mne sys_info + displayName: 'Print config and test access to commands' + - script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" + displayName: 'Get test data' + - script: pytest --tb=short --cov=mne -vv mne/viz + displayName: 'Run viz tests' + - script: codecov --root $BUILD_REPOSITORY_LOCALPATH -t $CODECOV_TOKEN + displayName: 'Codecov' + env: + CODECOV_TOKEN: $(CODECOV_TOKEN) + condition: succeededOrFailed() + - task: PublishTestResults@2 + inputs: + testResultsFiles: 'junit-*.xml' + testRunTitle: 'Publish test results for $(Agent.JobName)' + failTaskOnFailedTests: true + condition: succeededOrFailed() + + + - job: Windows + pool: + vmImage: 'VS2017-Win2016' + variables: + MNE_LOGGING_LEVEL: 'warning' + MNE_FORCE_SERIAL: 'true' + OPENBLAS_NUM_THREADS: 1 + PYTHONUNBUFFERED: 1 + PYTHONIOENCODING: 'utf-8' + MKL_NUM_THREADS: 1 + AZURE_CI_WINDOWS: 'true' + PYTHON_ARCH: 'x64' + strategy: + maxParallel: 4 + matrix: + 3.7 conda: + PLATFORM: 'x86-64' + TEST_MODE: 'conda' + PYTHON_VERSION: '3.8' + 3.7 pip: + TEST_MODE: 'pip' + PYTHON_VERSION: '3.7' + 3.8 pip pre: + TEST_MODE: 'pre-pip' + PYTHON_VERSION: '3.8' + OPENBLAS_CORETYPE: 'prescott' # workaround for https://github.com/numpy/numpy/issues/16913 + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: $(PYTHON_VERSION) + architecture: $(PYTHON_ARCH) + addToPath: true + condition: in(variables['TEST_MODE'], 'pip', 'pre-pip') + displayName: 'Get Python' + # https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/anaconda + # https://github.com/MicrosoftDocs/pipelines-anaconda + # Qt 5.9 post-link failure: + # https://github.com/ContinuumIO/anaconda-issues/issues/10949 + - script: echo "##vso[task.prependpath]%CONDA%;%CONDA%\condabin;%CONDA%\Scripts;%CONDA%\Library\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;" + condition: in(variables['TEST_MODE'], 'conda') + displayName: Add conda to PATH, deal with Qt 5.9 bug + - bash: | + set -e + git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git + powershell gl-ci-helpers/appveyor/install_opengl.ps1 + displayName: Install OpenGL + - bash: | + set -e + python -m pip install --upgrade pip "setuptools<50.0" + python -m pip install --upgrade numpy scipy vtk + python -m pip install --upgrade -r requirements.txt -r requirements_testing.txt + python -m pip install codecov + condition: eq(variables['TEST_MODE'], 'pip') + displayName: 'Install dependencies with pip' + - bash: | + set -e + python -m pip install --upgrade pip "setuptools<50.0" + python -m pip install --upgrade --pre --only-binary ":all:" -i "https://pypi.anaconda.org/scipy-wheels-nightly/simple" "numpy!=1.20.0.dev0+20201111233731.0ffaaf8,!=1.20.0.dev0+20201111232921.0ffaaf8" + python -m pip install --upgrade --pre --only-binary ":all:" -f "https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com" scipy pandas scikit-learn matplotlib h5py Pillow + python -m pip install --upgrade --only-binary vtk vtk; + python -m pip install https://github.com/pyvista/pyvista/zipball/master + python -m pip install https://github.com/pyvista/pyvistaqt/zipball/master + python -m pip install -r requirements.txt -r requirements_testing.txt codecov + condition: eq(variables['TEST_MODE'], 'pre-pip') + displayName: 'Install dependencies with pip --pre' + - powershell: | + Set-StrictMode -Version Latest + $ErrorActionPreference = "Stop" + $PSDefaultParameterValues['*:ErrorAction']='Stop' + conda update -n base -c defaults conda + conda env update --name base --file environment.yml + pip uninstall -yq mne + pip install -r requirements_testing.txt codecov + condition: eq(variables['TEST_MODE'], 'conda') + displayName: 'Install dependencies with conda' + - script: python setup.py develop + displayName: 'Install MNE-Python dev' + - script: mne sys_info + displayName: 'Print config and test access to commands' + - script: python -c "import numpy; numpy.show_config()" + displayName: Print NumPy config + - script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" + displayName: 'Get test data' + - script: pytest -m "not slowtest" --tb=short --cov=mne -vv mne + displayName: 'Run tests' + - script: codecov --root %BUILD_REPOSITORY_LOCALPATH% -t %CODECOV_TOKEN% + displayName: 'Codecov' + env: + CODECOV_TOKEN: $(CODECOV_TOKEN) + condition: succeededOrFailed() + - task: PublishTestResults@2 + inputs: + testResultsFiles: 'junit-*.xml' + testRunTitle: 'Publish test results for $(Agent.JobName) $(TEST_MODE) $(PYTHON_VERSION)' + failTaskOnFailedTests: true + condition: succeededOrFailed() diff --git a/tools/get_minimal_commands.sh b/tools/get_minimal_commands.sh index 37d5777cc90..399aeea130c 100755 --- a/tools/get_minimal_commands.sh +++ b/tools/get_minimal_commands.sh @@ -1,20 +1,22 @@ #!/bin/bash -ef -pushd ~ > /dev/null -export MNE_ROOT="${PWD}/minimal_cmds" -export PATH=${MNE_ROOT}/bin:$PATH -if [ "${TRAVIS_OS_NAME}" != "osx" ]; then - if [ ! -d "${PWD}/minimal_cmds" ]; then - curl -L https://osf.io/g7dzs/download | tar xz - fi; - export LD_LIBRARY_PATH=${MNE_ROOT}/lib:$LD_LIBRARY_PATH - export NEUROMAG2FT_ROOT="${PWD}/minimal_cmds/bin" - export FREESURFER_HOME="${MNE_ROOT}" -else - if [ ! -d "${PWD}/minimal_cmds" ]; then - curl -L https://osf.io/rjcz4/download | tar xz - fi; - export DYLD_LIBRARY_PATH=${MNE_ROOT}/lib:$DYLD_LIBRARY_PATH +if [ "${DEPS}" != "minimal" ]; then + pushd ~ > /dev/null + export MNE_ROOT="${PWD}/minimal_cmds" + export PATH=${MNE_ROOT}/bin:$PATH + if [ "${CI_OS_NAME}" != "osx" ]; then + if [ ! -d "${PWD}/minimal_cmds" ]; then + curl -L https://osf.io/g7dzs/download | tar xz + fi; + export LD_LIBRARY_PATH=${MNE_ROOT}/lib:$LD_LIBRARY_PATH + export NEUROMAG2FT_ROOT="${PWD}/minimal_cmds/bin" + export FREESURFER_HOME="${MNE_ROOT}" + else + if [ ! -d "${PWD}/minimal_cmds" ]; then + curl -L https://osf.io/rjcz4/download | tar xz + fi; + export DYLD_LIBRARY_PATH=${MNE_ROOT}/lib:$DYLD_LIBRARY_PATH + fi + popd > /dev/null + mne_surf2bem --version fi -popd > /dev/null -mne_surf2bem --version diff --git a/tools/github_actions_dependencies.sh b/tools/github_actions_dependencies.sh index d62670d1b63..407c4a29730 100755 --- a/tools/github_actions_dependencies.sh +++ b/tools/github_actions_dependencies.sh @@ -1,5 +1,18 @@ #!/bin/bash -ef -pip uninstall -yq mne +if [ ! -z "$CONDA_ENV" ]; then + pip uninstall -yq mne +elif [ ! -z "$CONDA_DEPENDENCIES" ]; then + conda install -y $CONDA_DEPENDENCIES +else # pip + python -m pip install --upgrade pip setuptools wheel + pip uninstall -yq numpy + pip install -i "https://pypi.anaconda.org/scipy-wheels-nightly/simple" --pre "numpy!=1.20.0.dev0+20201111233731.0ffaaf8,!=1.20.0.dev0+20201111232921.0ffaaf8" + pip install -f "https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com" scipy pandas scikit-learn matplotlib h5py Pillow + pip install https://github.com/pyvista/pyvista/zipball/master + pip install https://github.com/pyvista/pyvistaqt/zipball/master +fi pip install --upgrade -r requirements_testing.txt -pip install nitime +if [ "${DEPS}" != "minimal" ]; then + pip install nitime +fi diff --git a/tools/github_actions_download.sh b/tools/github_actions_download.sh index fdd8bce0a70..68f56256998 100755 --- a/tools/github_actions_download.sh +++ b/tools/github_actions_download.sh @@ -1,3 +1,5 @@ #!/bin/bash -ef -python -c 'import mne; mne.datasets.testing.data_path(verbose=True)'; +if [ "${DEPS}" != "minimal" ]; then + python -c 'import mne; mne.datasets.testing.data_path(verbose=True)'; +fi diff --git a/tools/github_actions_test.sh b/tools/github_actions_test.sh index 93ab26e706d..9add6bcbe6f 100755 --- a/tools/github_actions_test.sh +++ b/tools/github_actions_test.sh @@ -1,10 +1,31 @@ #!/bin/bash -ef +# Remove numpydoc tests on older Python (builtin docstrings not as good) +if [ "${PYTHON_VERSION}" == "3.6" ]; then + pip uninstall -yq numpydoc; +fi; + +# Test run_tests_if_main +if [ "${DEPS}" == "minimal" ]; then + pip uninstall -yq mne; + pip install -e .; + python mne/tests/test_evoked.py; +fi; + USE_DIRS="mne/" -if [ "${TRAVIS_OS_NAME}" != "osx" ]; then +if [ "${CI_OS_NAME}" != "osx" ]; then CONDITION="not ultraslowtest" else CONDITION="not slowtest" fi echo 'pytest -m "${CONDITION}" --tb=short --cov=mne --cov-report xml -vv ${USE_DIRS}' pytest -m "${CONDITION}" --tb=short --cov=mne --cov-report xml -vv ${USE_DIRS} + +# run the minimal one with the testing data as well +if [ "${DEPS}" == "minimal" ]; then + export MNE_SKIP_TESTING_DATASET_TESTS=false; + python -c 'import mne; mne.datasets.testing.data_path(verbose=True)'; +fi; +if [ "${DEPS}" == "minimal" ]; then + pytest -m "${CONDITION}" --tb=short --cov=mne -vv ${USE_DIRS}; +fi;