From 12395f9d9cf6ea3c72b225b62e052dd0d17d9889 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 7 Aug 2023 17:10:48 -0400 Subject: [PATCH] MAINT: Fix YAML spacing (#11868) --- .circleci/config.yml | 980 ++++++++++++++++++------------------ .github/workflows/tests.yml | 54 +- .pre-commit-config.yaml | 74 +-- .yamllint.yml | 8 - azure-pipelines.yml | 572 ++++++++++----------- environment.yml | 112 ++--- 6 files changed, 896 insertions(+), 904 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3f69f9f2e87..6bfb8cf68dd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,519 +22,519 @@ _check_skip: &check_skip fi jobs: - pytest-macos-arm64: - parameters: - scheduled: - type: string - default: "false" - macos: - xcode: "14.2.0" - resource_class: macos.m1.medium.gen1 - environment: - HOMEBREW_NO_AUTO_UPDATE: 1 - steps: - - checkout - - run: - <<: *check_skip - - run: - name: Install Python and dependencies - command: | - set -eo pipefail - brew install python@3.11 - which python - which pip - pip install --upgrade pip setuptools wheel - pip install --upgrade --only-binary "numpy,scipy,dipy,statsmodels" -ve . -r requirements.txt -r requirements_testing.txt -r requirements_testing_extra.txt PyQt6 - # 3D too slow on Apple's software renderer, and numba causes us problems - pip uninstall -y vtk pyvista pyvistaqt numba - mkdir -p test-results - echo "set -eo pipefail" >> $BASH_ENV - - run: - command: mne sys_info - - run: - command: ./tools/get_testing_version.sh && cat testing_version.txt - - restore_cache: - keys: - - data-cache-testing-{{ checksum "testing_version.txt" }} - - run: - command: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" - - save_cache: - key: data-cache-testing-{{ checksum "testing_version.txt" }} - paths: - - ~/mne_data/MNE-testing-data # (2.5 G) - - run: - command: pytest -m "not slowtest" --tb=short --cov=mne --cov-report xml -vv mne - - run: - name: Prepare test data upload - command: cp -av junit-results.xml test-results/junit.xml - - store_test_results: - path: ./test-results - # Codecov orb has bugs on macOS (gpg issues) - # - codecov/upload - - run: - command: bash <(curl -s https://codecov.io/bash) + pytest-macos-arm64: + parameters: + scheduled: + type: string + default: "false" + macos: + xcode: "14.2.0" + resource_class: macos.m1.medium.gen1 + environment: + HOMEBREW_NO_AUTO_UPDATE: 1 + steps: + - checkout + - run: + <<: *check_skip + - run: + name: Install Python and dependencies + command: | + set -eo pipefail + brew install python@3.11 + which python + which pip + pip install --upgrade pip setuptools wheel + pip install --upgrade --only-binary "numpy,scipy,dipy,statsmodels" -ve . -r requirements.txt -r requirements_testing.txt -r requirements_testing_extra.txt PyQt6 + # 3D too slow on Apple's software renderer, and numba causes us problems + pip uninstall -y vtk pyvista pyvistaqt numba + mkdir -p test-results + echo "set -eo pipefail" >> $BASH_ENV + - run: + command: mne sys_info + - run: + command: ./tools/get_testing_version.sh && cat testing_version.txt + - restore_cache: + keys: + - data-cache-testing-{{ checksum "testing_version.txt" }} + - run: + command: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" + - save_cache: + key: data-cache-testing-{{ checksum "testing_version.txt" }} + paths: + - ~/mne_data/MNE-testing-data # (2.5 G) + - run: + command: pytest -m "not slowtest" --tb=short --cov=mne --cov-report xml -vv mne + - run: + name: Prepare test data upload + command: cp -av junit-results.xml test-results/junit.xml + - store_test_results: + path: ./test-results + # Codecov orb has bugs on macOS (gpg issues) + # - codecov/upload + - run: + command: bash <(curl -s https://codecov.io/bash) - build_docs: - parameters: - scheduled: - type: string - default: "false" - docker: - - image: cimg/base:current-22.04 - # large 4 vCPUs 15GB mem - # https://discuss.circleci.com/t/changes-to-remote-docker-reporting-pricing/47759 - resource_class: large - steps: - - restore_cache: - keys: - - source-cache - - checkout - - run: - name: Complete checkout - command: | - set -e - if ! git remote -v | grep upstream; then - git remote add upstream https://github.com/mne-tools/mne-python.git - fi - git remote set-url upstream https://github.com/mne-tools/mne-python.git - git fetch upstream - - save_cache: - key: source-cache - paths: - - ".git" - - run: - <<: *check_skip - - run: - name: Merge with upstream and triage run - command: | - set -e - echo $(git log -1 --pretty=%B) | tee gitlog.txt - echo ${CI_PULL_REQUEST//*pull\//} | tee merge.txt - if [[ $(cat merge.txt) != "" ]]; then - echo "Merging $(cat merge.txt)"; - git pull --ff-only upstream "refs/pull/$(cat merge.txt)/merge"; + build_docs: + parameters: + scheduled: + type: string + default: "false" + docker: + - image: cimg/base:current-22.04 + # large 4 vCPUs 15GB mem + # https://discuss.circleci.com/t/changes-to-remote-docker-reporting-pricing/47759 + resource_class: large + steps: + - restore_cache: + keys: + - source-cache + - checkout + - run: + name: Complete checkout + command: | + set -e + if ! git remote -v | grep upstream; then + git remote add upstream https://github.com/mne-tools/mne-python.git + fi + git remote set-url upstream https://github.com/mne-tools/mne-python.git + git fetch upstream + - save_cache: + key: source-cache + paths: + - ".git" + - run: + <<: *check_skip + - run: + name: Merge with upstream and triage run + command: | + set -e + echo $(git log -1 --pretty=%B) | tee gitlog.txt + echo ${CI_PULL_REQUEST//*pull\//} | tee merge.txt + if [[ $(cat merge.txt) != "" ]]; then + echo "Merging $(cat merge.txt)"; + git pull --ff-only upstream "refs/pull/$(cat merge.txt)/merge"; + else + if [[ "$CIRCLE_BRANCH" == "main" ]]; then + KIND=dev else - if [[ "$CIRCLE_BRANCH" == "main" ]]; then - KIND=dev - else - KIND=stable - fi - export COMMIT_MESSAGE=$(git log --format=oneline -n 1); - if [[ "<< parameters.scheduled >>" == "true" ]]; then - echo "Scheduled full build detected, checking if it's required." - wget https://mne.tools/${KIND}/_version.txt; - REMOTE_VERSION=$(cat _version.txt) - THIS_VERSION=$(git rev-parse HEAD) - echo "Current ${KIND} SHA: ${REMOTE_VERSION}" - echo "This ${KIND} SHA: ${THIS_VERSION}" - if [[ "${THIS_VERSION}" != "${REMOTE_VERSION}" ]]; then - echo "Rebuild required." - else - echo "Rebuild skipped." - circleci-agent step halt; - fi - elif [[ "$COMMIT_MESSAGE" == *"[circle deploy]"* ]]; then - echo "Forced deployed build detected, building and deploying docs"; + KIND=stable + fi + export COMMIT_MESSAGE=$(git log --format=oneline -n 1); + if [[ "<< parameters.scheduled >>" == "true" ]]; then + echo "Scheduled full build detected, checking if it's required." + wget https://mne.tools/${KIND}/_version.txt; + REMOTE_VERSION=$(cat _version.txt) + THIS_VERSION=$(git rev-parse HEAD) + echo "Current ${KIND} SHA: ${REMOTE_VERSION}" + echo "This ${KIND} SHA: ${THIS_VERSION}" + if [[ "${THIS_VERSION}" != "${REMOTE_VERSION}" ]]; then + echo "Rebuild required." else - echo "Waiting until scheduled run to build ${KIND} docs, exiting job ${CIRCLE_JOB}." + echo "Rebuild skipped." circleci-agent step halt; fi + elif [[ "$COMMIT_MESSAGE" == *"[circle deploy]"* ]]; then + echo "Forced deployed build detected, building and deploying docs"; + else + echo "Waiting until scheduled run to build ${KIND} docs, exiting job ${CIRCLE_JOB}." + circleci-agent step halt; fi + fi - - run: - name: Set BASH_ENV - command: ./tools/circleci_bash_env.sh + - run: + name: Set BASH_ENV + command: ./tools/circleci_bash_env.sh - - run: - name: check neuromag2ft - command: | - neuromag2ft --version + - run: + name: check neuromag2ft + command: | + neuromag2ft --version - - run: - 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 - 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 + - run: + 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 + 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 - - restore_cache: - keys: - - pip-cache - - restore_cache: - keys: - - user-install-bin-cache-310 + # Load pip cache + - restore_cache: + keys: + - pip-cache + - restore_cache: + keys: + - user-install-bin-cache-310 - # Hack in uninstalls of libraries as necessary if pip doesn't do the right thing in upgrading for us... - - run: - name: Get Python running - command: | - ./tools/circleci_dependencies.sh + # Hack in uninstalls of libraries as necessary if pip doesn't do the right thing in upgrading for us... + - run: + name: Get Python running + command: | + ./tools/circleci_dependencies.sh - - save_cache: - key: pip-cache - paths: - - ~/.cache/pip - - save_cache: - key: user-install-bin-cache-310 - paths: - - ~/.local/lib/python3.10/site-packages - - ~/.local/bin + - save_cache: + key: pip-cache + paths: + - ~/.cache/pip + - save_cache: + key: user-install-bin-cache-310 + paths: + - ~/.local/lib/python3.10/site-packages + - ~/.local/bin - - run: - name: Check Qt - command: | - ./tools/check_qt_import.sh PyQt6 - # Load tiny cache so that ~/.mne does not need to be created below - - restore_cache: - keys: - - data-cache-tiny-0 + - run: + name: Check Qt + command: | + ./tools/check_qt_import.sh PyQt6 + # Load tiny cache so that ~/.mne does not need to be created below + - restore_cache: + keys: + - data-cache-tiny-0 - # Look at what we have and fail early if there is some library conflict - - run: - name: Check installation - command: | - which python - QT_DEBUG_PLUGINS=1 mne sys_info -pd - python -c "import numpy; numpy.show_config()" - LIBGL_DEBUG=verbose python -c "import pyvistaqt; pyvistaqt.BackgroundPlotter(show=True)" - python -c "import mne; mne.set_config('MNE_USE_CUDA', 'false')" # this is needed for the config tutorial - python -c "import mne; mne.set_config('MNE_LOGGING_LEVEL', 'info')" - python -c "import mne; level = mne.get_config('MNE_LOGGING_LEVEL'); assert level.lower() == 'info', repr(level)" - - run: - name: List packages - command: python -m pip list + # Look at what we have and fail early if there is some library conflict + - run: + name: Check installation + command: | + which python + QT_DEBUG_PLUGINS=1 mne sys_info -pd + python -c "import numpy; numpy.show_config()" + LIBGL_DEBUG=verbose python -c "import pyvistaqt; pyvistaqt.BackgroundPlotter(show=True)" + python -c "import mne; mne.set_config('MNE_USE_CUDA', 'false')" # this is needed for the config tutorial + python -c "import mne; mne.set_config('MNE_LOGGING_LEVEL', 'info')" + python -c "import mne; level = mne.get_config('MNE_LOGGING_LEVEL'); assert level.lower() == 'info', repr(level)" + - run: + name: List packages + command: python -m pip list - # Figure out if we should run a full, pattern, or noplot version - - restore_cache: - keys: - - data-cache-tiny-1 - - restore_cache: - keys: - - data-cache-multimodal - - restore_cache: - keys: - - data-cache-limo - - restore_cache: - keys: - - data-cache-fsaverage - - restore_cache: - keys: - - data-cache-bst-phantom-ctf - - restore_cache: - keys: - - data-cache-bst-raw - - restore_cache: - keys: - - data-cache-bst-phantom-elekta - - restore_cache: - keys: - - data-cache-bst-auditory - - restore_cache: - keys: - - data-cache-bst-resting - - restore_cache: - keys: - - data-cache-fieldtrip - - restore_cache: - keys: - - data-cache-somato - - restore_cache: - keys: - - data-cache-hf-sef - - restore_cache: - keys: - - data-cache-opm - - restore_cache: - keys: - - data-cache-sample - - restore_cache: - keys: - - data-cache-spm-face - - restore_cache: - keys: - - data-cache-testing - - restore_cache: - keys: - - data-cache-visual - - restore_cache: - keys: - - data-cache-ucl-opm-auditory - - run: - name: Get data - # This limit could be increased, but this is helpful for finding slow ones - # (even ~2GB datasets should be downloadable in this time from good - # providers) - no_output_timeout: 10m - command: | - ./tools/circleci_download.sh - - run: - name: Verify build type - command: | - echo "PATTERN=$(cat pattern.txt)" - echo "BUILD=$(cat build.txt)" - ls -al ~/mne_data; + # Figure out if we should run a full, pattern, or noplot version + - restore_cache: + keys: + - data-cache-tiny-1 + - restore_cache: + keys: + - data-cache-multimodal + - restore_cache: + keys: + - data-cache-limo + - restore_cache: + keys: + - data-cache-fsaverage + - restore_cache: + keys: + - data-cache-bst-phantom-ctf + - restore_cache: + keys: + - data-cache-bst-raw + - restore_cache: + keys: + - data-cache-bst-phantom-elekta + - restore_cache: + keys: + - data-cache-bst-auditory + - restore_cache: + keys: + - data-cache-bst-resting + - restore_cache: + keys: + - data-cache-fieldtrip + - restore_cache: + keys: + - data-cache-somato + - restore_cache: + keys: + - data-cache-hf-sef + - restore_cache: + keys: + - data-cache-opm + - restore_cache: + keys: + - data-cache-sample + - restore_cache: + keys: + - data-cache-spm-face + - restore_cache: + keys: + - data-cache-testing + - restore_cache: + keys: + - data-cache-visual + - restore_cache: + keys: + - data-cache-ucl-opm-auditory + - run: + name: Get data + # This limit could be increased, but this is helpful for finding slow ones + # (even ~2GB datasets should be downloadable in this time from good + # providers) + no_output_timeout: 10m + command: | + ./tools/circleci_download.sh + - run: + name: Verify build type + command: | + echo "PATTERN=$(cat pattern.txt)" + echo "BUILD=$(cat build.txt)" + ls -al ~/mne_data; - # Run doctest (if it's full or front) before building the docs - - run: - name: make test-doc - command: | - if [[ $(cat gitlog.txt) == *"[circle front]"* ]] || [[ $(cat build.txt) == "html-memory" ]] ; then - make test-doc; - mkdir -p doc/_build/test-results/test-doc; - cp junit-results.xml doc/_build/test-results/test-doc/junit.xml; - fi; - # Build docs - - run: - name: make html - command: | - PATTERN=$(cat pattern.txt) make -C doc $(cat build.txt); - - run: - name: Show profiling output - when: always - command: | - if compgen -G "doc/*.dat" > /dev/null; then - mkdir -p doc/generated - mprof plot doc/*.dat --output doc/generated/memory.png - else - echo "No profile data found in doc/" - fi - - run: - name: Sanity check system state - command: | - python -c "import mne; level = mne.get_config('MNE_LOGGING_LEVEL'); assert level.lower() == 'info', repr(level)" + # Run doctest (if it's full or front) before building the docs + - run: + name: make test-doc + command: | + if [[ $(cat gitlog.txt) == *"[circle front]"* ]] || [[ $(cat build.txt) == "html-memory" ]] ; then + make test-doc; + mkdir -p doc/_build/test-results/test-doc; + cp junit-results.xml doc/_build/test-results/test-doc/junit.xml; + fi; + # Build docs + - run: + name: make html + command: | + PATTERN=$(cat pattern.txt) make -C doc $(cat build.txt); + - run: + name: Show profiling output + when: always + command: | + if compgen -G "doc/*.dat" > /dev/null; then + mkdir -p doc/generated + mprof plot doc/*.dat --output doc/generated/memory.png + else + echo "No profile data found in doc/" + fi + - run: + name: Sanity check system state + command: | + python -c "import mne; level = mne.get_config('MNE_LOGGING_LEVEL'); assert level.lower() == 'info', repr(level)" - # Reduce upload time of artifacts we will (almost) never look at - - run: - name: Reduce artifact upload time - command: | - if grep -q html-pattern-memory build.txt || grep -q html-noplot build.txt; then - zip -rm doc/_build/html/_downloads.zip doc/_build/html/_downloads - fi - for NAME in generated auto_tutorials auto_examples; do - zip -rm doc/${NAME}.zip doc/${NAME} - done + # Reduce upload time of artifacts we will (almost) never look at + - run: + name: Reduce artifact upload time + command: | + if grep -q html-pattern-memory build.txt || grep -q html-noplot build.txt; then + zip -rm doc/_build/html/_downloads.zip doc/_build/html/_downloads + fi + for NAME in generated auto_tutorials auto_examples; do + zip -rm doc/${NAME}.zip doc/${NAME} + done - # Save the JUnit file - - store_test_results: - path: doc/_build/test-results - - store_artifacts: - path: doc/_build/test-results - destination: test-results - # Save the SG RST - - store_artifacts: - path: doc/auto_examples.zip - - store_artifacts: - path: doc/auto_tutorials.zip - - store_artifacts: - path: doc/generated.zip - # Save the HTML - - store_artifacts: - path: doc/_build/html/ - destination: html - - persist_to_workspace: - root: doc/_build - paths: - - html + # Save the JUnit file + - store_test_results: + path: doc/_build/test-results + - store_artifacts: + path: doc/_build/test-results + destination: test-results + # Save the SG RST + - store_artifacts: + path: doc/auto_examples.zip + - store_artifacts: + path: doc/auto_tutorials.zip + - store_artifacts: + path: doc/generated.zip + # Save the HTML + - store_artifacts: + path: doc/_build/html/ + destination: html + - persist_to_workspace: + root: doc/_build + paths: + - html - # Keep these separate, maybe better in terms of size limitations (?) - - save_cache: - key: data-cache-tiny-0 # < 100 M, might as well combine - paths: - - ~/.mne - - ~/mne_data/MNE-kiloword-data # (28 M) - - ~/mne_data/MNE-eegbci-data # (35 M) - - ~/mne_data/MNE-misc-data # (39 M) - - ~/mne_data/mTRF_1.5 # (56 M) - - ~/mne_data/MNE-phantom-4DBTi # (77 M) - - save_cache: - key: data-cache-tiny-1 # more to combine - paths: - - ~/mne_data/MNE-fNIRS-motor-data # (71 M) - - ~/mne_data/MNE-refmeg-noise-data # (93 M) - - ~/mne_data/physionet-sleep-data # (95 M) - - save_cache: - key: data-cache-multimodal - paths: - - ~/mne_data/MNE-multimodal-data # (240 M) - - save_cache: - key: data-cache-limo - paths: - - ~/mne_data/MNE-limo-data # (244 M) - - save_cache: - key: data-cache-fsaverage - paths: - - ~/mne_data/MNE-fsaverage-data # (762 M) - - save_cache: - key: data-cache-bst-phantom-ctf - paths: - - ~/mne_data/MNE-brainstorm-data/bst_phantom_ctf # (177 M) - - save_cache: - key: data-cache-bst-raw - paths: - - ~/mne_data/MNE-brainstorm-data/bst_raw # (830 M) - - save_cache: - key: data-cache-bst-phantom-elekta - paths: - - ~/mne_data/MNE-brainstorm-data/bst_phantom_elekta # (1.4 G) - - save_cache: - key: data-cache-bst-auditory - paths: - - ~/mne_data/MNE-brainstorm-data/bst_auditory # (2.9 G) - - save_cache: - key: data-cache-bst-resting - paths: - - ~/mne_data/MNE-brainstorm-data/bst_resting # (4.5 G) - - save_cache: - key: data-cache-fieldtrip - paths: - - ~/mne_data/MNE-fieldtrip_cmc-data # (699 M) - - save_cache: - key: data-cache-somato - paths: - - ~/mne_data/MNE-somato-data # (750 M) - - save_cache: - key: data-cache-hf-sef - paths: - - ~/mne_data/HF_SEF # (1.3 G) - - save_cache: - key: data-cache-opm - paths: - - ~/mne_data/MNE-OPM-data # (1.9 G) - - save_cache: - key: data-cache-sample - paths: - - ~/mne_data/MNE-sample-data # (3.2 G) - - save_cache: - key: data-cache-spm-face - paths: - - ~/mne_data/MNE-spm-face # (1.5 G) - - save_cache: - key: data-cache-testing - paths: - - ~/mne_data/MNE-testing-data # (2.5 G) - - save_cache: - key: data-cache-visual - paths: - - ~/mne_data/MNE-visual_92_categories-data # (6 G) - - save_cache: - key: data-cache-ucl-opm-auditory - paths: - - ~/mne_data/auditory_OPM_stationary # (4 G) + # Keep these separate, maybe better in terms of size limitations (?) + - save_cache: + key: data-cache-tiny-0 # < 100 M, might as well combine + paths: + - ~/.mne + - ~/mne_data/MNE-kiloword-data # (28 M) + - ~/mne_data/MNE-eegbci-data # (35 M) + - ~/mne_data/MNE-misc-data # (39 M) + - ~/mne_data/mTRF_1.5 # (56 M) + - ~/mne_data/MNE-phantom-4DBTi # (77 M) + - save_cache: + key: data-cache-tiny-1 # more to combine + paths: + - ~/mne_data/MNE-fNIRS-motor-data # (71 M) + - ~/mne_data/MNE-refmeg-noise-data # (93 M) + - ~/mne_data/physionet-sleep-data # (95 M) + - save_cache: + key: data-cache-multimodal + paths: + - ~/mne_data/MNE-multimodal-data # (240 M) + - save_cache: + key: data-cache-limo + paths: + - ~/mne_data/MNE-limo-data # (244 M) + - save_cache: + key: data-cache-fsaverage + paths: + - ~/mne_data/MNE-fsaverage-data # (762 M) + - save_cache: + key: data-cache-bst-phantom-ctf + paths: + - ~/mne_data/MNE-brainstorm-data/bst_phantom_ctf # (177 M) + - save_cache: + key: data-cache-bst-raw + paths: + - ~/mne_data/MNE-brainstorm-data/bst_raw # (830 M) + - save_cache: + key: data-cache-bst-phantom-elekta + paths: + - ~/mne_data/MNE-brainstorm-data/bst_phantom_elekta # (1.4 G) + - save_cache: + key: data-cache-bst-auditory + paths: + - ~/mne_data/MNE-brainstorm-data/bst_auditory # (2.9 G) + - save_cache: + key: data-cache-bst-resting + paths: + - ~/mne_data/MNE-brainstorm-data/bst_resting # (4.5 G) + - save_cache: + key: data-cache-fieldtrip + paths: + - ~/mne_data/MNE-fieldtrip_cmc-data # (699 M) + - save_cache: + key: data-cache-somato + paths: + - ~/mne_data/MNE-somato-data # (750 M) + - save_cache: + key: data-cache-hf-sef + paths: + - ~/mne_data/HF_SEF # (1.3 G) + - save_cache: + key: data-cache-opm + paths: + - ~/mne_data/MNE-OPM-data # (1.9 G) + - save_cache: + key: data-cache-sample + paths: + - ~/mne_data/MNE-sample-data # (3.2 G) + - save_cache: + key: data-cache-spm-face + paths: + - ~/mne_data/MNE-spm-face # (1.5 G) + - save_cache: + key: data-cache-testing + paths: + - ~/mne_data/MNE-testing-data # (2.5 G) + - save_cache: + key: data-cache-visual + paths: + - ~/mne_data/MNE-visual_92_categories-data # (6 G) + - save_cache: + key: data-cache-ucl-opm-auditory + paths: + - ~/mne_data/auditory_OPM_stationary # (4 G) - linkcheck: - # there are a few files excluded from this for expediency, see Makefile - parameters: - scheduled: - type: string - default: "false" - docker: - - image: cimg/base:current-22.04 - steps: - - restore_cache: - keys: - - source-cache - - checkout - - run: - name: Check-skip - command: | - export COMMIT_MESSAGE=$(git log --format=oneline -n 1); - if [[ "$COMMIT_MESSAGE" != *"[circle linkcheck]"* ]] && [ "<< parameters.scheduled >>" != "true" ]; then - echo "Skip detected, exiting job ${CIRCLE_JOB}." - circleci-agent step halt; - fi - - run: - name: Set BASH_ENV - command: ./tools/circleci_bash_env.sh - - restore_cache: - keys: - - pip-cache - - run: - name: Get Python running - command: | - ./tools/circleci_dependencies.sh - - run: - name: Check installation - command: | - mne sys_info -pd - - run: - name: make linkcheck - command: | - make -C doc linkcheck - - run: - name: make linkcheck-grep - when: always - command: | - make -C doc linkcheck-grep - - store_artifacts: - path: doc/_build/linkcheck - destination: linkcheck + linkcheck: + # there are a few files excluded from this for expediency, see Makefile + parameters: + scheduled: + type: string + default: "false" + docker: + - image: cimg/base:current-22.04 + steps: + - restore_cache: + keys: + - source-cache + - checkout + - run: + name: Check-skip + command: | + export COMMIT_MESSAGE=$(git log --format=oneline -n 1); + if [[ "$COMMIT_MESSAGE" != *"[circle linkcheck]"* ]] && [ "<< parameters.scheduled >>" != "true" ]; then + echo "Skip detected, exiting job ${CIRCLE_JOB}." + circleci-agent step halt; + fi + - run: + name: Set BASH_ENV + command: ./tools/circleci_bash_env.sh + - restore_cache: + keys: + - pip-cache + - run: + name: Get Python running + command: | + ./tools/circleci_dependencies.sh + - run: + name: Check installation + command: | + mne sys_info -pd + - run: + name: make linkcheck + command: | + make -C doc linkcheck + - run: + name: make linkcheck-grep + when: always + command: | + make -C doc linkcheck-grep + - store_artifacts: + path: doc/_build/linkcheck + destination: linkcheck - deploy: - machine: - image: ubuntu-2004:202111-01 - steps: - - attach_workspace: - at: /tmp/build - - restore_cache: - keys: - - website-cache - - run: - name: Set BASH_ENV - command: | - set -e - echo "set -e" >> $BASH_ENV - # Don't try to deploy if nothing is there or not on the right branch - - run: - name: Check docs - command: | - if [ ! -f /tmp/build/html/index.html ] ; then - echo "No files found to upload (build: ${CIRCLE_BRANCH})."; - circleci-agent step halt; - fi; - - run: - name: Fetch docs - command: | - mkdir -p ~/.ssh - echo -e "Host *\nStrictHostKeyChecking no" > ~/.ssh/config - chmod og= ~/.ssh/config - if [ ! -d ~/mne-tools.github.io ]; then - git clone git@github.com:/mne-tools/mne-tools.github.io.git ~/mne-tools.github.io --depth=1 - fi - - run: - name: Deploy docs - command: | - git config --global user.email "circle@mne.tools"; - git config --global user.name "Circle CI"; - cd ~/mne-tools.github.io; - git checkout main - git remote -v - git fetch origin - git reset --hard origin/main - git clean -xdf - if [ "${CIRCLE_BRANCH}" == "main" ]; then - echo "Deploying dev docs for ${CIRCLE_BRANCH}."; - rm -Rf dev; - cp -a /tmp/build/html dev; - git add -A; - git commit -m "CircleCI update of dev docs (${CIRCLE_BUILD_NUM})."; - else - echo "Deploying stable docs for ${CIRCLE_BRANCH}."; - rm -Rf stable; - cp -a /tmp/build/html stable; - git add -A; - git commit -m "CircleCI update of stable docs (${CIRCLE_BUILD_NUM})."; - fi; - git push origin main; - - save_cache: - key: website-cache - paths: - - ~/mne_data/MNE-visual_92_categories-data + deploy: + machine: + image: ubuntu-2004:202111-01 + steps: + - attach_workspace: + at: /tmp/build + - restore_cache: + keys: + - website-cache + - run: + name: Set BASH_ENV + command: | + set -e + echo "set -e" >> $BASH_ENV + # Don't try to deploy if nothing is there or not on the right branch + - run: + name: Check docs + command: | + if [ ! -f /tmp/build/html/index.html ] ; then + echo "No files found to upload (build: ${CIRCLE_BRANCH})."; + circleci-agent step halt; + fi; + - run: + name: Fetch docs + command: | + mkdir -p ~/.ssh + echo -e "Host *\nStrictHostKeyChecking no" > ~/.ssh/config + chmod og= ~/.ssh/config + if [ ! -d ~/mne-tools.github.io ]; then + git clone git@github.com:/mne-tools/mne-tools.github.io.git ~/mne-tools.github.io --depth=1 + fi + - run: + name: Deploy docs + command: | + git config --global user.email "circle@mne.tools"; + git config --global user.name "Circle CI"; + cd ~/mne-tools.github.io; + git checkout main + git remote -v + git fetch origin + git reset --hard origin/main + git clean -xdf + if [ "${CIRCLE_BRANCH}" == "main" ]; then + echo "Deploying dev docs for ${CIRCLE_BRANCH}."; + rm -Rf dev; + cp -a /tmp/build/html dev; + git add -A; + git commit -m "CircleCI update of dev docs (${CIRCLE_BUILD_NUM})."; + else + echo "Deploying stable docs for ${CIRCLE_BRANCH}."; + rm -Rf stable; + cp -a /tmp/build/html stable; + git add -A; + git commit -m "CircleCI update of stable docs (${CIRCLE_BUILD_NUM})."; + fi; + git push origin main; + - save_cache: + key: website-cache + paths: + - ~/mne_data/MNE-visual_92_categories-data workflows: default: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e3b68d5f591..7cdb6113675 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,12 +19,12 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 3 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - uses: psf/black@stable - - uses: pre-commit/action@v3.0.0 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + - uses: psf/black@stable + - uses: pre-commit/action@v3.0.0 pytest: name: '${{ matrix.os }} / ${{ matrix.kind }} / ${{ matrix.python }}' @@ -45,27 +45,27 @@ jobs: strategy: matrix: include: - - os: ubuntu-latest - python: '3.10' - kind: conda - - os: ubuntu-latest - python: '3.10' - kind: notebook - - os: ubuntu-latest - python: '3.11' - kind: pip-pre - - os: macos-latest - python: '3.8' - kind: mamba - - os: windows-latest - python: '3.10' - kind: mamba - - os: ubuntu-latest - python: '3.8' - kind: minimal - - os: ubuntu-20.04 - python: '3.8' - kind: old + - os: ubuntu-latest + python: '3.10' + kind: conda + - os: ubuntu-latest + python: '3.10' + kind: notebook + - os: ubuntu-latest + python: '3.11' + kind: pip-pre + - os: macos-latest + python: '3.8' + kind: mamba + - os: windows-latest + python: '3.10' + kind: mamba + - os: ubuntu-latest + python: '3.8' + kind: minimal + - os: ubuntu-20.04 + python: '3.8' + kind: old steps: - uses: actions/checkout@v3 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3652212839..3bc2624adc6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,42 +1,42 @@ repos: -- repo: https://github.com/psf/black - rev: 23.7.0 - hooks: - - id: black - args: [--quiet] + - repo: https://github.com/psf/black + rev: 23.7.0 + hooks: + - id: black + args: [--quiet] -# Ruff mne -- repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.281 - hooks: - - id: ruff - name: ruff mne - files: ^mne/ + # Ruff mne + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.281 + hooks: + - id: ruff + name: ruff mne + files: ^mne/ -# Ruff tutorials and examples -- repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.281 - hooks: - - id: ruff - name: ruff tutorials and examples - # D103: missing docstring in public function - # D400: docstring first line must end with period - args: ["--ignore=D103,D400"] - files: ^tutorials/|^examples/ + # Ruff tutorials and examples + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.281 + hooks: + - id: ruff + name: ruff tutorials and examples + # D103: missing docstring in public function + # D400: docstring first line must end with period + args: ["--ignore=D103,D400"] + files: ^tutorials/|^examples/ -# Codespell -- repo: https://github.com/codespell-project/codespell - rev: v2.2.5 - hooks: - - id: codespell - additional_dependencies: - - tomli - files: ^mne/|^doc/|^examples/|^tutorials/ - types_or: [python, bib, rst, inc] + # Codespell + - repo: https://github.com/codespell-project/codespell + rev: v2.2.5 + hooks: + - id: codespell + additional_dependencies: + - tomli + files: ^mne/|^doc/|^examples/|^tutorials/ + types_or: [python, bib, rst, inc] -# yamllint -- repo: https://github.com/adrienverge/yamllint.git - rev: v1.29.0 - hooks: - - id: yamllint - args: [--strict, -c, .yamllint.yml] + # yamllint + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.29.0 + hooks: + - id: yamllint + args: [--strict, -c, .yamllint.yml] diff --git a/.yamllint.yml b/.yamllint.yml index 56f0b30f26f..f54915d4c1c 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -6,11 +6,3 @@ ignore: | rules: line-length: disable document-start: disable - indentation: - # We should fix these in a follow-up PR and add to git-revs-ignore - ignore: | - .pre-commit-config.yaml - azure-pipelines.yml - .circleci/config.yml - environment.yml - .github/workflows/tests.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8c3502d123d..54c8ed58be5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,295 +13,295 @@ pr: stages: -- stage: Check - jobs: - - job: Skip - pool: - vmImage: 'ubuntu-latest' - variables: - DECODE_PERCENTS: 'false' - RET: 'true' - BUILD_REASON: $(Build.Reason) - steps: - - bash: | - git_log=`git log --format=oneline -n 1 --skip=1` - echo "##vso[task.setvariable variable=log]$git_log" - - bash: echo "##vso[task.setvariable variable=RET]false" - condition: and(eq(variables.BUILD_REASON, 'PullRequest'), 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 + - stage: Check + jobs: + - job: Skip + pool: + vmImage: 'ubuntu-latest' + variables: + DECODE_PERCENTS: 'false' + RET: 'true' + BUILD_REASON: $(Build.Reason) + steps: + - bash: | + git_log=`git log --format=oneline -n 1 --skip=1` + echo "##vso[task.setvariable variable=log]$git_log" + - bash: echo "##vso[task.setvariable variable=RET]false" + condition: and(eq(variables.BUILD_REASON, 'PullRequest'), 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 -- stage: Style - variables: - AZURE_CI: 'true' - jobs: - - job: All - pool: - vmImage: 'ubuntu-latest' + - stage: Style variables: - PYTHON_VERSION: '3.11' - 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 -eo pipefail - python -m pip install --progress-bar off --upgrade pip setuptools wheel - python -m pip install --progress-bar off -r requirements_base.txt -r requirements_hdf5.txt -r requirements_testing.txt - python -m pip uninstall -yq pytest-qt # don't want to set up display, etc. for this - pre-commit install --install-hooks - displayName: Install dependencies - - bash: | - make pre-commit - displayName: make pre-commit - condition: always() - - 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() + AZURE_CI: 'true' + jobs: + - job: All + pool: + vmImage: 'ubuntu-latest' + variables: + PYTHON_VERSION: '3.11' + 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 -eo pipefail + python -m pip install --progress-bar off --upgrade pip setuptools wheel + python -m pip install --progress-bar off -r requirements_base.txt -r requirements_hdf5.txt -r requirements_testing.txt + python -m pip uninstall -yq pytest-qt # don't want to set up display, etc. for this + pre-commit install --install-hooks + displayName: Install dependencies + - bash: | + make pre-commit + displayName: make pre-commit + condition: always() + - 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() -- stage: Test - condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) - dependsOn: ['Style', 'Check'] - variables: - AZURE_CI: 'true' - jobs: - - job: Ultraslow_PG - pool: - vmImage: 'ubuntu-22.04' + - stage: Test + condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) + dependsOn: ['Style', 'Check'] variables: - DISPLAY: ':99' - OPENBLAS_NUM_THREADS: '1' - steps: - - bash: | - set -e - ./tools/setup_xvfb.sh - sudo apt install -yq tcsh - displayName: 'Install Ubuntu dependencies' - - bash: | - source tools/get_minimal_commands.sh - displayName: 'Install minimal commands' - - bash: | - echo $PATH - mne_surf2bem --version - fsl_rigid_register --version - displayName: 'Test minimal commands' - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.9' - architecture: 'x64' - addToPath: true - displayName: 'Get Python' - - bash: | - set -e - python -m pip install --progress-bar off --upgrade pip setuptools wheel - python -m pip install --progress-bar off mne-qt-browser[opengl] pyvista scikit-learn pytest-error-for-skips python-picard "PyQt6!=6.5.1" qtpy - python -m pip uninstall -yq mne - python -m pip install --progress-bar off --upgrade -e .[test] - displayName: 'Install dependencies with pip' - - bash: | - set -e - mne sys_info -pd - mne sys_info -pd | grep "qtpy .*(PyQt6=.*)$" - displayName: Print config - # Uncomment if "xcb not found" Qt errors/segfaults come up again - # - bash: | - # set -e - # LD_DEBUG=libs python -c "from PyQt6.QtWidgets import QApplication, QWidget; app = QApplication([]); import matplotlib; matplotlib.use('QtAgg'); import matplotlib.pyplot as plt; plt.figure()" - - bash: source tools/get_testing_version.sh - displayName: 'Get testing version' - - task: Cache@2 - inputs: - key: $(testing_version) - path: /home/vsts/mne_data - displayName: 'Cache testing data' - - script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" - displayName: 'Get test data' - - script: pytest --error-for-skips -m "ultraslowtest or pgtest" --tb=short --cov=mne --cov-report=xml --cov-report=html -vv mne - displayName: 'slow and mne-qt-browser tests' - # Coverage - - bash: bash <(curl -s https://codecov.io/bash) - displayName: 'Codecov' - condition: succeededOrFailed() - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/junit-*.xml' - testRunTitle: 'Publish test results for $(Agent.JobName)' - failTaskOnFailedTests: true - condition: succeededOrFailed() - - task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' - reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov' + AZURE_CI: 'true' + jobs: + - job: Ultraslow_PG + pool: + vmImage: 'ubuntu-22.04' + variables: + DISPLAY: ':99' + OPENBLAS_NUM_THREADS: '1' + steps: + - bash: | + set -e + ./tools/setup_xvfb.sh + sudo apt install -yq tcsh + displayName: 'Install Ubuntu dependencies' + - bash: | + source tools/get_minimal_commands.sh + displayName: 'Install minimal commands' + - bash: | + echo $PATH + mne_surf2bem --version + fsl_rigid_register --version + displayName: 'Test minimal commands' + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.9' + architecture: 'x64' + addToPath: true + displayName: 'Get Python' + - bash: | + set -e + python -m pip install --progress-bar off --upgrade pip setuptools wheel + python -m pip install --progress-bar off mne-qt-browser[opengl] pyvista scikit-learn pytest-error-for-skips python-picard "PyQt6!=6.5.1" qtpy + python -m pip uninstall -yq mne + python -m pip install --progress-bar off --upgrade -e .[test] + displayName: 'Install dependencies with pip' + - bash: | + set -e + mne sys_info -pd + mne sys_info -pd | grep "qtpy .*(PyQt6=.*)$" + displayName: Print config + # Uncomment if "xcb not found" Qt errors/segfaults come up again + # - bash: | + # set -e + # LD_DEBUG=libs python -c "from PyQt6.QtWidgets import QApplication, QWidget; app = QApplication([]); import matplotlib; matplotlib.use('QtAgg'); import matplotlib.pyplot as plt; plt.figure()" + - bash: source tools/get_testing_version.sh + displayName: 'Get testing version' + - task: Cache@2 + inputs: + key: $(testing_version) + path: /home/vsts/mne_data + displayName: 'Cache testing data' + - script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" + displayName: 'Get test data' + - script: pytest --error-for-skips -m "ultraslowtest or pgtest" --tb=short --cov=mne --cov-report=xml --cov-report=html -vv mne + displayName: 'slow and mne-qt-browser tests' + # Coverage + - bash: bash <(curl -s https://codecov.io/bash) + displayName: 'Codecov' + condition: succeededOrFailed() + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/junit-*.xml' + testRunTitle: 'Publish test results for $(Agent.JobName)' + failTaskOnFailedTests: true + condition: succeededOrFailed() + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' + reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov' - - job: Qt - pool: - vmImage: 'ubuntu-22.04' - variables: - DISPLAY: ':99' - OPENBLAS_NUM_THREADS: '1' - TEST_OPTIONS: "--tb=short --cov=mne --cov-report=xml --cov-report=html --cov-append -vv mne/viz/_brain mne/viz/backends mne/viz/tests/test_evoked.py mne/gui mne/report" - steps: - - bash: ./tools/setup_xvfb.sh - displayName: 'Install Ubuntu dependencies' - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.10' - architecture: 'x64' - addToPath: true - displayName: 'Get Python' - - bash: | - set -e - python -m pip install --progress-bar off --upgrade pip setuptools wheel - python -m pip install --progress-bar off --upgrade --pre --only-binary=\"numpy,scipy,matplotlib,vtk\" numpy scipy matplotlib vtk - python -c "import vtk" - python -m pip install --progress-bar off --upgrade -r requirements.txt -r requirements_testing.txt -r requirements_testing_extra.txt - python -m pip install -e . - displayName: 'Install dependencies with pip' - - bash: | - set -e - which mne - mne sys_info -pd - python ./tools/check_mne_location.py - displayName: Print config - - bash: source tools/get_testing_version.sh - displayName: 'Get testing version' - - task: Cache@2 - inputs: - key: $(testing_version) - path: /home/vsts/mne_data - displayName: 'Cache testing data' - - script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" - displayName: 'Get test data' - - bash: | - set -e - python -m pip install PyQt6 - # Uncomment if "xcb not found" Qt errors/segfaults come up again - # LD_DEBUG=libs python -c "from PyQt6.QtWidgets import QApplication, QWidget; app = QApplication([]); import matplotlib; matplotlib.use('QtAgg'); import matplotlib.pyplot as plt; plt.figure()" - mne sys_info -pd - mne sys_info -pd | grep "qtpy .* (PyQt6=.*)$" - PYTEST_QT_API=PyQt6 pytest -m "not slowtest" ${TEST_OPTIONS} - python -m pip uninstall -yq PyQt6 PyQt6-sip PyQt6-Qt6 - displayName: 'PyQt6' - - bash: | - set -e - python -m pip install PySide6 - mne sys_info -pd - mne sys_info -pd | grep "qtpy .* (PySide6=.*)$" - PYTEST_QT_API=PySide6 pytest -m "not slowtest" ${TEST_OPTIONS} - python -m pip uninstall -yq PySide6 - displayName: 'PySide6' - - bash: | - set -e - python -m pip install PySide2 - mne sys_info -pd - mne sys_info -pd | grep "qtpy .* (PySide2=.*)$" - PYTEST_QT_API=PySide2 pytest -m "not slowtest" ${TEST_OPTIONS} - python -m pip uninstall -yq PySide2 - displayName: 'PySide2' - # PyQt5 leaves cruft behind, so run it last - - bash: | - set -e - python -m pip install PyQt5 - mne sys_info -pd - mne sys_info -pd | grep "qtpy .* (PyQt5=.*)$" - PYTEST_QT_API=PyQt5 pytest -m "not slowtest" ${TEST_OPTIONS} - python -m pip uninstall -yq PyQt5 PyQt5-sip PyQt5-Qt5 - displayName: 'PyQt5' - # Coverage - - bash: bash <(curl -s https://codecov.io/bash) - displayName: 'Codecov' - condition: succeededOrFailed() - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/junit-*.xml' - testRunTitle: 'Publish test results for $(Agent.JobName)' - failTaskOnFailedTests: true - condition: succeededOrFailed() - - task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' - reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov' + - job: Qt + pool: + vmImage: 'ubuntu-22.04' + variables: + DISPLAY: ':99' + OPENBLAS_NUM_THREADS: '1' + TEST_OPTIONS: "--tb=short --cov=mne --cov-report=xml --cov-report=html --cov-append -vv mne/viz/_brain mne/viz/backends mne/viz/tests/test_evoked.py mne/gui mne/report" + steps: + - bash: ./tools/setup_xvfb.sh + displayName: 'Install Ubuntu dependencies' + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.10' + architecture: 'x64' + addToPath: true + displayName: 'Get Python' + - bash: | + set -e + python -m pip install --progress-bar off --upgrade pip setuptools wheel + python -m pip install --progress-bar off --upgrade --pre --only-binary=\"numpy,scipy,matplotlib,vtk\" numpy scipy matplotlib vtk + python -c "import vtk" + python -m pip install --progress-bar off --upgrade -r requirements.txt -r requirements_testing.txt -r requirements_testing_extra.txt + python -m pip install -e . + displayName: 'Install dependencies with pip' + - bash: | + set -e + which mne + mne sys_info -pd + python ./tools/check_mne_location.py + displayName: Print config + - bash: source tools/get_testing_version.sh + displayName: 'Get testing version' + - task: Cache@2 + inputs: + key: $(testing_version) + path: /home/vsts/mne_data + displayName: 'Cache testing data' + - script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" + displayName: 'Get test data' + - bash: | + set -e + python -m pip install PyQt6 + # Uncomment if "xcb not found" Qt errors/segfaults come up again + # LD_DEBUG=libs python -c "from PyQt6.QtWidgets import QApplication, QWidget; app = QApplication([]); import matplotlib; matplotlib.use('QtAgg'); import matplotlib.pyplot as plt; plt.figure()" + mne sys_info -pd + mne sys_info -pd | grep "qtpy .* (PyQt6=.*)$" + PYTEST_QT_API=PyQt6 pytest -m "not slowtest" ${TEST_OPTIONS} + python -m pip uninstall -yq PyQt6 PyQt6-sip PyQt6-Qt6 + displayName: 'PyQt6' + - bash: | + set -e + python -m pip install PySide6 + mne sys_info -pd + mne sys_info -pd | grep "qtpy .* (PySide6=.*)$" + PYTEST_QT_API=PySide6 pytest -m "not slowtest" ${TEST_OPTIONS} + python -m pip uninstall -yq PySide6 + displayName: 'PySide6' + - bash: | + set -e + python -m pip install PySide2 + mne sys_info -pd + mne sys_info -pd | grep "qtpy .* (PySide2=.*)$" + PYTEST_QT_API=PySide2 pytest -m "not slowtest" ${TEST_OPTIONS} + python -m pip uninstall -yq PySide2 + displayName: 'PySide2' + # PyQt5 leaves cruft behind, so run it last + - bash: | + set -e + python -m pip install PyQt5 + mne sys_info -pd + mne sys_info -pd | grep "qtpy .* (PyQt5=.*)$" + PYTEST_QT_API=PyQt5 pytest -m "not slowtest" ${TEST_OPTIONS} + python -m pip uninstall -yq PyQt5 PyQt5-sip PyQt5-Qt5 + displayName: 'PyQt5' + # Coverage + - bash: bash <(curl -s https://codecov.io/bash) + displayName: 'Codecov' + condition: succeededOrFailed() + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/junit-*.xml' + testRunTitle: 'Publish test results for $(Agent.JobName)' + failTaskOnFailedTests: true + condition: succeededOrFailed() + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' + reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov' - - job: Windows - pool: - vmImage: 'windows-latest' - variables: - MNE_LOGGING_LEVEL: 'warning' - MNE_FORCE_SERIAL: 'true' - OPENBLAS_NUM_THREADS: 2 - OMP_DYNAMIC: 'false' - PYTHONUNBUFFERED: 1 - PYTHONIOENCODING: 'utf-8' - AZURE_CI_WINDOWS: 'true' - PYTHON_ARCH: 'x64' - timeoutInMinutes: 70 - strategy: - maxParallel: 4 - matrix: - 3.9 pip: - TEST_MODE: 'pip' - PYTHON_VERSION: '3.9' - 3.10 pip pre: - TEST_MODE: 'pip-pre' - PYTHON_VERSION: '3.10' - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: $(PYTHON_VERSION) - architecture: $(PYTHON_ARCH) - addToPath: true - displayName: 'Get Python' - - bash: | - 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: ./tools/azure_dependencies.sh - displayName: Install dependencies with pip - - script: pip install -e . - displayName: 'Install MNE-Python dev' - - script: mne sys_info -pd - displayName: 'Print config' - - script: python -c "import numpy; numpy.show_config()" - displayName: Print NumPy config - - bash: source tools/get_testing_version.sh - displayName: 'Get testing version' - - task: Cache@2 - inputs: - key: $(testing_version) - path: C:\Users\VssAdministrator\mne_data - displayName: 'Cache testing data' - - script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" - displayName: 'Get test data' - - script: pytest -m "not (slowtest or pgtest)" --tb=short --cov=mne --cov-report=xml --cov-report=html -vv mne - displayName: 'Run tests' - - bash: bash <(curl -s https://codecov.io/bash) - displayName: 'Codecov' - condition: succeededOrFailed() - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/junit-*.xml' - testRunTitle: 'Publish test results for $(Agent.JobName) $(TEST_MODE) $(PYTHON_VERSION)' - failTaskOnFailedTests: true - condition: succeededOrFailed() - - task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' - reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov' + - job: Windows + pool: + vmImage: 'windows-latest' + variables: + MNE_LOGGING_LEVEL: 'warning' + MNE_FORCE_SERIAL: 'true' + OPENBLAS_NUM_THREADS: 2 + OMP_DYNAMIC: 'false' + PYTHONUNBUFFERED: 1 + PYTHONIOENCODING: 'utf-8' + AZURE_CI_WINDOWS: 'true' + PYTHON_ARCH: 'x64' + timeoutInMinutes: 70 + strategy: + maxParallel: 4 + matrix: + 3.9 pip: + TEST_MODE: 'pip' + PYTHON_VERSION: '3.9' + 3.10 pip pre: + TEST_MODE: 'pip-pre' + PYTHON_VERSION: '3.10' + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: $(PYTHON_VERSION) + architecture: $(PYTHON_ARCH) + addToPath: true + displayName: 'Get Python' + - bash: | + 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: ./tools/azure_dependencies.sh + displayName: Install dependencies with pip + - script: pip install -e . + displayName: 'Install MNE-Python dev' + - script: mne sys_info -pd + displayName: 'Print config' + - script: python -c "import numpy; numpy.show_config()" + displayName: Print NumPy config + - bash: source tools/get_testing_version.sh + displayName: 'Get testing version' + - task: Cache@2 + inputs: + key: $(testing_version) + path: C:\Users\VssAdministrator\mne_data + displayName: 'Cache testing data' + - script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" + displayName: 'Get test data' + - script: pytest -m "not (slowtest or pgtest)" --tb=short --cov=mne --cov-report=xml --cov-report=html -vv mne + displayName: 'Run tests' + - bash: bash <(curl -s https://codecov.io/bash) + displayName: 'Codecov' + condition: succeededOrFailed() + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/junit-*.xml' + testRunTitle: 'Publish test results for $(Agent.JobName) $(TEST_MODE) $(PYTHON_VERSION)' + failTaskOnFailedTests: true + condition: succeededOrFailed() + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' + reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov' diff --git a/environment.yml b/environment.yml index 3d7c5926fc5..fb848ecaece 100644 --- a/environment.yml +++ b/environment.yml @@ -1,59 +1,59 @@ name: mne channels: -- conda-forge + - conda-forge dependencies: -- python>=3.8 -- pip -- numpy -- scipy -- matplotlib -- tqdm -- pooch>=1.5 -- decorator -- h5io -- packaging -- numba -- pandas -- xlrd -- scikit-learn -- h5py -- jinja2 -- pillow -- statsmodels -- jupyter -- ipython !=8.7.0 -- joblib -- psutil -- numexpr -- imageio -- spyder-kernels>=1.10.0 -- imageio>=2.6.1 -- imageio-ffmpeg>=0.4.1 -- vtk>=9.2 -- traitlets -- pyvista>=0.32,!=0.35.2,!=0.38.0,!=0.38.1,!=0.38.2,!=0.38.3,!=0.38.4,!=0.38.5,!=0.38.6 -- pyvistaqt>=0.4 -- qdarkstyle -- darkdetect -- dipy -- nibabel -- openmeeg>=2.5.5 -- nilearn -- python-picard -- qtpy -- pyqt!=5.15.3,!=5.15.4 -- mne -- mffpy>=0.5.7 -- ipyevents -- ipywidgets -- ipympl -- ipyvtklink -- jupyter_client -- nbformat -- nbclient -- mne-qt-browser -- pymatreader -- eeglabio -- edflib-python -- pybv -- mamba + - python>=3.8 + - pip + - numpy + - scipy + - matplotlib + - tqdm + - pooch>=1.5 + - decorator + - h5io + - packaging + - numba + - pandas + - xlrd + - scikit-learn + - h5py + - jinja2 + - pillow + - statsmodels + - jupyter + - ipython !=8.7.0 + - joblib + - psutil + - numexpr + - imageio + - spyder-kernels>=1.10.0 + - imageio>=2.6.1 + - imageio-ffmpeg>=0.4.1 + - vtk>=9.2 + - traitlets + - pyvista>=0.32,!=0.35.2,!=0.38.0,!=0.38.1,!=0.38.2,!=0.38.3,!=0.38.4,!=0.38.5,!=0.38.6 + - pyvistaqt>=0.4 + - qdarkstyle + - darkdetect + - dipy + - nibabel + - openmeeg>=2.5.5 + - nilearn + - python-picard + - qtpy + - pyqt!=5.15.3,!=5.15.4 + - mne + - mffpy>=0.5.7 + - ipyevents + - ipywidgets + - ipympl + - ipyvtklink + - jupyter_client + - nbformat + - nbclient + - mne-qt-browser + - pymatreader + - eeglabio + - edflib-python + - pybv + - mamba