Skip to content

Commit

Permalink
MRG: Azure (mne-tools#6011)
Browse files Browse the repository at this point in the history
* Set up CI with Azure Pipelines

* FIX: Try conda too

* FIX: yaml

* WIP [skip appveyor] [skip travis] [skip circle]

* WIP [skip appveyor] [skip travis] [skip circle]

* WIP [skip appveyor] [skip travis] [skip circle]

* WIP [skip appveyor] [skip travis] [skip circle]

* WIP [skip appveyor] [skip travis] [skip circle]

* WIP [skip appveyor] [skip travis]

* WIP [skip appveyor] [skip travis]

* WIP [skip appveyor] [skip travis]

* FIX: Conditionals [skip travis] [skip appveyor]

* WIP: [skip travis] [skip appveyor]

* WIP: [skip travis] [skip appveyor]

* WIP [skip travis] [skip appveyor]

* WIP [skip travis] [skip appveyor]

* FIX: Refreshenv [skip travis] [skip appveyor]

* FIX: Refreshenv [skip travis] [skip appveyor]

* FIX: Refreshenv [skip travis] [skip appveyor]

* FIX: Refreshenv [skip travis] [skip appveyor]

* FIX: Fix for xlrd

* FIX: conftest

* FIX: Fixes

* FIX: OpenBLAS

* FIX: Give up on x86

* DOC: Comment [ci skip]

* FIX: Arch

* FIX: Try longer timeout

* FIX: Token

* FIX: Mapped

* FIX? [skip travis] [skip appveyor]
  • Loading branch information
larsoner authored and agramfort committed Mar 2, 2019
1 parent b6571d6 commit ce50c2b
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.junit-results.xml
*.pyc
*.pyo
*.sh
Expand Down
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
# OPENBLAS_NUM_THREADS=1 avoid slowdowns:
# https://github.com/xianyi/OpenBLAS/issues/731
global: PYTHON_VERSION=3.6 DISPLAY=:99.0 MNE_LOGGING_LEVEL=warning TEST_LOCATION=src
PIP_DEPENDENCIES="codecov pytest-faulthandler pytest-sugar pytest-timeout nitime"
PIP_DEPENDENCIES="codecov nitime"
TRAVIS_PYTHON_VERSION=3.6 CONDA_VERSION=">=4.3.27"
OPENBLAS_NUM_THREADS=1

Expand All @@ -18,8 +18,8 @@ matrix:
# No data + style testing
- os: linux
env: DEPS=nodata MNE_DONTWRITE_HOME=true MNE_FORCE_SERIAL=true MNE_SKIP_NETWORK_TEST=1
CONDA_DEPENDENCIES="numpy scipy matplotlib sphinx pytest pytest-cov mock pytest-mock"
PIP_DEPENDENCIES="flake8 numpydoc codespell git+git://github.com/PyCQA/pydocstyle.git codecov check-manifest pytest-faulthandler pytest-sugar pytest-timeout"
CONDA_DEPENDENCIES="numpy scipy matplotlib sphinx pytest pytest-timeout pytest-cov pytest-mock"
PIP_DEPENDENCIES="flake8 numpydoc codespell pydocstyle codecov check-manifest pytest-sugar pytest-faulthandler"

# Linux
- os: linux
Expand All @@ -42,12 +42,13 @@ matrix:
# Old dependencies
- os: linux
env: PYTHON_VERSION=3.5
CONDA_DEPENDENCIES="numpy=1.11 scipy=0.17 matplotlib=1.5 pandas=0.18 scikit-learn=0.18 pytest pytest-cov pytest-mock"
CONDA_DEPENDENCIES="numpy=1.11 scipy=0.17 matplotlib=1.5 pandas=0.18 scikit-learn=0.18 pytest pytest-cov pytest-mock pytest-timeout"

# Minimal
- os: linux
env: DEPS=minimial
CONDA_DEPENDENCIES="numpy scipy matplotlib pytest pytest-cov pytest-faulthandler pytest-timeout pytest-mock"
CONDA_DEPENDENCIES="numpy scipy matplotlib pytest pytest-cov pytest-mock pytest-timeout"
PIP_DEPENDENCIES="pytest-faulthandler pytest-sugar"

# Setup anaconda
before_install:
Expand Down
77 changes: 77 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
trigger:
# start a new build for every push
batch: False
branches:
include:
- master
- maint/*

jobs:
- job: Windows
pool:
vmIMage: 'VS2017-Win2016'
variables:
MNE_LOGGING_LEVEL: 'warning'
PIP_DEPENDENCIES: 'codecov'
OPENBLAS_NUM_THREADS: 1
strategy:
maxParallel: 4
matrix:
# Eventually we should test x86 (32-bit), but it was a nightmare
# to get it to download 32-bit Anaconda properly, and VTK does not ship
# 32-bit Windows binaries via pip.
Python35-64bit-full:
PYTHON_VERSION: '3.5'
PLATFORM: 'x86-64'
TEST_MODE: 'conda'
CONDA_ENVIRONMENT: 'environment.yml'
Python37-64bit-full:
PYTHON_VERSION: '3.7'
PYTHON_ARCH: 'x64'
TEST_MODE: 'pip'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
architecture: $(PYTHON_ARCH)
addToPath: true
condition: eq(variables['TEST_MODE'], 'pip')
- powershell: |
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$PSDefaultParameterValues['*:ErrorAction']='Stop'
pip install --upgrade numpy scipy vtk
pip install --upgrade -r requirements.txt
pip install $env:PIP_DEPENDENCIES
condition: eq(variables['TEST_MODE'], 'pip')
displayName: 'Install dependencies with pip'
- powershell: |
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$PSDefaultParameterValues['*:ErrorAction']='Stop'
$env:PYTHON = '$(System.DefaultWorkingDirectory)' + '\conda'
git clone git://github.com/astropy/ci-helpers.git
powershell ci-helpers/appveyor/install-miniconda.ps1
$env:PATH = $env:PYTHON + "\envs\test;" + $env:PYTHON + "\envs\test\Scripts;" + $env:PYTHON + ";" + $env:PYTHON + "\Scripts;" + $env:PATH
pip uninstall -yq mne
Write-Host ("##vso[task.setvariable variable=PATH]" + $env:PATH)
condition: eq(variables['TEST_MODE'], 'conda')
displayName: 'Install dependencies with conda'
- script: python setup.py develop
displayName: 'Install MNE-Python dev'
- script: python -c "import mne; print(mne.sys_info())"
displayName: 'Print config'
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
displayName: 'Get test data'
- script: pytest -m "not ultraslowtest" mne --cov=mne
displayName: 'Run tests'
- script: codecov --root %BUILD_REPOSITORY_LOCALPATH% -t %CODECOV_TOKEN%
displayName: 'Codecov'
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
condition: always()
- task: PublishTestResults@2
inputs:
testResultsFiles: 'junit-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
condition: always()
8 changes: 6 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
# @larsoner has had problems a couple of years ago where a mayavi import
# seemed to corrupt SciPy linalg function results (!), likely due to the
# associated VTK import, so this could be another manifestation of that.
import readline # noqa
try:
import readline # noqa
except Exception:
pass

import numpy as np
import mne
Expand All @@ -35,7 +38,8 @@
def matplotlib_config():
"""Configure matplotlib for viz tests."""
import matplotlib
matplotlib.use('agg') # don't pop up windows
# "force" should not really be necessary but should not hurt
matplotlib.use('agg', force=True) # don't pop up windows
import matplotlib.pyplot as plt
assert plt.get_backend() == 'agg'
# overwrite some params that can horribly slow down tests that
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dependencies:
- nilearn
- neo
- pytest-faulthandler
- pytest-sugar
- pydocstyle
- codespell
- python-picard
2 changes: 1 addition & 1 deletion mne/inverse_sparse/tests/test_mxne_inverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _check_stcs(stc1, stc2):
assert_allclose(stc1.tstep, stc2.tstep)


@pytest.mark.timeout(60) # ~30 sec on AppVeyor and Travis Linux
@pytest.mark.timeout(120) # ~30 sec on AppVeyor and Travis Linux
@pytest.mark.slowtest
@testing.requires_testing_data
def test_mxne_inverse_standard():
Expand Down
1 change: 1 addition & 0 deletions mne/tests/test_epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2136,6 +2136,7 @@ def test_array_epochs(tmpdir):
assert_array_equal(epochs.events[:, 2], np.ones(len(data_1), int))


@pytest.mark.timeout(60) # can be slow on Azure
def test_concatenate_epochs():
"""Test concatenate epochs."""
raw, events, picks = _get_data()
Expand Down
3 changes: 2 additions & 1 deletion mne/utils/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ def check_version(library, min_version):
ok = False
else:
if min_version:
this_version = LooseVersion(library.__version__.lstrip('v'))
this_version = LooseVersion(
getattr(library, '__version__', '0.0').lstrip('v'))
if this_version < min_version:
ok = False
return ok
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ python-picard
statsmodels
pytest
pytest-cov
pytest-sugar
pytest-timeout
pytest-faulthandler
pytest-mock
pytest-sugar
pytest-timeout
joblib
psutil
dipy
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ release = egg_info -RDb ''
doc-files = doc

[tool:pytest]
addopts = --showlocals --durations=20 --doctest-modules -rs --cov-report= --doctest-ignore-import-errors --ignore=mne/gui/_coreg_gui.py --ignore=mne/gui/_fiducials_gui.py --ignore=mne/gui/_file_traits.py --ignore=mne/gui/_kit2fiff_gui.py --ignore=mne/gui/_marker_gui.py --ignore=mne/gui/_viewer.py
addopts = --showlocals --durations=20 --doctest-modules -rs --cov-report= --doctest-ignore-import-errors --junit-xml=junit-results.xml --ignore=mne/gui/_coreg_gui.py --ignore=mne/gui/_fiducials_gui.py --ignore=mne/gui/_file_traits.py --ignore=mne/gui/_kit2fiff_gui.py --ignore=mne/gui/_marker_gui.py --ignore=mne/gui/_viewer.py
usefixtures = matplotlib_config
# Set this pretty low to ensure we do not by default add really long tests,
# or make changes that make things a lot slower
Expand Down

0 comments on commit ce50c2b

Please sign in to comment.