From fb54f05d07d92ca514d3752f395416a69d60c03f Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 30 Jul 2019 09:25:29 -0400 Subject: [PATCH 1/6] CI: Add Azure Pipeline for Python 3.5 --- .azure-pipelines/windows.yml | 51 ++++++++++++++++++++++++++++++++++++ azure-pipelines.yml | 10 +++++++ 2 files changed, 61 insertions(+) create mode 100644 .azure-pipelines/windows.yml create mode 100644 azure-pipelines.yml diff --git a/.azure-pipelines/windows.yml b/.azure-pipelines/windows.yml new file mode 100644 index 0000000000..af77e7717c --- /dev/null +++ b/.azure-pipelines/windows.yml @@ -0,0 +1,51 @@ + +parameters: + name: '' + vmImage: '' + matrix: [] + +jobs: +- job: ${{ parameters.name }} + pool: + vmImage: ${{ parameters.vmImage }} + variables: + VIRTUALENV: 'testvenv' + strategy: + matrix: + ${{ insert }}: ${{ parameters.matrix }} + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(PYTHON_VERSION)' + addToPath: true + architecture: '$(PYTHON_ARCH)' + - script: | + python -m pip install --upgrade pip virtualenv + virtualenv --python=python venv + venv\\scripts\\activate + python --version + python -m pip install --upgrade pip setuptools>=30.3.0 wheel + displayName: 'Install virtualenv' + - script: | + # Optional dependencies + python -m pip install numpy scipy matplotlib h5py pydicom + # Test dependencies + python -m pip install nose mock coverage codecov + displayName: 'Install dependencies' + - script: | + python -m pip install . + SET NIBABEL_DATA_DIR=%CD%\\nibabel-data + displayName: 'Install nibabel' + - script: | + # Change into an innocuous directory and find tests from installation + mkdir for_testing + cd for_testing + cp ../.coveragerc . + nosetests --with-doctest --with-coverage --cover-package nibabel nibabel + displayName: 'Install nibabel' + - script: | + codecov + displayName: 'Upload To Codecov' + env: + CODECOV_TOKEN: $(CODECOV_TOKEN) diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..9b11ad1deb --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,10 @@ +# Adapted from https://github.com/pandas-dev/pandas/blob/master/azure-pipelines.yml +jobs: +- template: .azure-pipelines/windows.yml + parameters: + name: Windows + vmImage: vs2017-win2016 + matrix: + py35: + PYTHON_VERSION: '3.5' + PYTHON_ARCH: 'x64' From c436091db15d95cc755dfe1df3cbfc4dc6e65e6a Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 30 Jul 2019 09:42:37 -0400 Subject: [PATCH 2/6] CI: Remove AppVeyor --- appveyor.yml | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 796c74a7da..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,46 +0,0 @@ -# vim ft=yaml -# CI on Windows via appveyor - -environment: - - matrix: - - PYTHON: C:\Python27 - - PYTHON: C:\Python27-x64 - - PYTHON: C:\Python34 - - PYTHON: C:\Python34-x64 - - PYTHON: C:\Python35 - - PYTHON: C:\Python35-x64 - - PYTHON: C:\Python36 - - PYTHON: C:\Python36-x64 - - PYTHON: C:\Python37 - - PYTHON: C:\Python37-x64 - -install: - # Prepend newly installed Python to the PATH of this build (this cannot be - # done from inside the powershell script as it would require to restart - # the parent CMD process). - - SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH% - - - python -m pip install --upgrade pip virtualenv - - virtualenv --python=python venv - - venv\Scripts\activate - - python --version - - # Install the dependencies of the project. - - pip install --upgrade pip setuptools>=27.0 wheel - - pip install numpy scipy matplotlib h5py pydicom - - pip install nose mock coverage codecov - - pip install . - - SET NIBABEL_DATA_DIR=%CD%\nibabel-data - -build: false # Not a C# project, build stuff at the test step instead. - -test_script: - # Change into an innocuous directory and find tests from installation - - mkdir for_testing - - cd for_testing - - cp ../.coveragerc . - - nosetests --with-doctest --with-coverage --cover-package nibabel nibabel - -after_test: - - codecov From c33e5592899626ae59b15b4f91a006b61c963e69 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 30 Jul 2019 09:58:24 -0400 Subject: [PATCH 3/6] AZURE: Environment reset at each step --- .azure-pipelines/windows.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/windows.yml b/.azure-pipelines/windows.yml index af77e7717c..4251a4e558 100644 --- a/.azure-pipelines/windows.yml +++ b/.azure-pipelines/windows.yml @@ -28,23 +28,25 @@ jobs: python -m pip install --upgrade pip setuptools>=30.3.0 wheel displayName: 'Install virtualenv' - script: | - # Optional dependencies + venv\\scripts\\activate python -m pip install numpy scipy matplotlib h5py pydicom - # Test dependencies python -m pip install nose mock coverage codecov displayName: 'Install dependencies' - script: | + venv\\scripts\\activate python -m pip install . SET NIBABEL_DATA_DIR=%CD%\\nibabel-data displayName: 'Install nibabel' - script: | - # Change into an innocuous directory and find tests from installation + venv\\scripts\\activate mkdir for_testing cd for_testing cp ../.coveragerc . nosetests --with-doctest --with-coverage --cover-package nibabel nibabel displayName: 'Install nibabel' - script: | + venv\\scripts\\activate + cd for_testing codecov displayName: 'Upload To Codecov' env: From aabd9fbf54b4e56ec51ee0a9782a9cc86fd6a870 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 30 Jul 2019 10:03:53 -0400 Subject: [PATCH 4/6] AZURE: Virtualenvs do not seem to work as expected --- .azure-pipelines/windows.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.azure-pipelines/windows.yml b/.azure-pipelines/windows.yml index 4251a4e558..3bf81d7ef3 100644 --- a/.azure-pipelines/windows.yml +++ b/.azure-pipelines/windows.yml @@ -8,8 +8,6 @@ jobs: - job: ${{ parameters.name }} pool: vmImage: ${{ parameters.vmImage }} - variables: - VIRTUALENV: 'testvenv' strategy: matrix: ${{ insert }}: ${{ parameters.matrix }} @@ -21,31 +19,23 @@ jobs: addToPath: true architecture: '$(PYTHON_ARCH)' - script: | - python -m pip install --upgrade pip virtualenv - virtualenv --python=python venv - venv\\scripts\\activate - python --version python -m pip install --upgrade pip setuptools>=30.3.0 wheel - displayName: 'Install virtualenv' + displayName: 'Update build tools' - script: | - venv\\scripts\\activate python -m pip install numpy scipy matplotlib h5py pydicom python -m pip install nose mock coverage codecov displayName: 'Install dependencies' - script: | - venv\\scripts\\activate python -m pip install . SET NIBABEL_DATA_DIR=%CD%\\nibabel-data displayName: 'Install nibabel' - script: | - venv\\scripts\\activate mkdir for_testing cd for_testing cp ../.coveragerc . nosetests --with-doctest --with-coverage --cover-package nibabel nibabel displayName: 'Install nibabel' - script: | - venv\\scripts\\activate cd for_testing codecov displayName: 'Upload To Codecov' From 147f954d3952c28d862999b454be8b6f2d39fedd Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 30 Jul 2019 10:06:47 -0400 Subject: [PATCH 5/6] AZURE: Fix step name --- .azure-pipelines/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/windows.yml b/.azure-pipelines/windows.yml index 3bf81d7ef3..831bd614df 100644 --- a/.azure-pipelines/windows.yml +++ b/.azure-pipelines/windows.yml @@ -34,7 +34,7 @@ jobs: cd for_testing cp ../.coveragerc . nosetests --with-doctest --with-coverage --cover-package nibabel nibabel - displayName: 'Install nibabel' + displayName: 'Nose tests' - script: | cd for_testing codecov From 9b0e4c918a7571a4cceb122fce1cc0c4dedc9a37 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 30 Jul 2019 10:17:40 -0400 Subject: [PATCH 6/6] AZURE: Expand matrix to Python 3.4-3.7, x86 and x64 --- .azure-pipelines/windows.yml | 4 +++- azure-pipelines.yml | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/windows.yml b/.azure-pipelines/windows.yml index 831bd614df..ad1b72eb77 100644 --- a/.azure-pipelines/windows.yml +++ b/.azure-pipelines/windows.yml @@ -8,6 +8,8 @@ jobs: - job: ${{ parameters.name }} pool: vmImage: ${{ parameters.vmImage }} + variables: + EXTRA_WHEELS: "https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com" strategy: matrix: ${{ insert }}: ${{ parameters.matrix }} @@ -22,7 +24,7 @@ jobs: python -m pip install --upgrade pip setuptools>=30.3.0 wheel displayName: 'Update build tools' - script: | - python -m pip install numpy scipy matplotlib h5py pydicom + python -m pip install --find-links %EXTRA_WHEELS% numpy scipy matplotlib h5py pydicom python -m pip install nose mock coverage codecov displayName: 'Install dependencies' - script: | diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9b11ad1deb..cb2612d5c3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,6 +5,21 @@ jobs: name: Windows vmImage: vs2017-win2016 matrix: - py35: + py35-x86: PYTHON_VERSION: '3.5' + PYTHON_ARCH: 'x86' + py35-x64: + PYTHON_VERSION: '3.5' + PYTHON_ARCH: 'x64' + py36-x86: + PYTHON_VERSION: '3.6' + PYTHON_ARCH: 'x86' + py36-x64: + PYTHON_VERSION: '3.6' + PYTHON_ARCH: 'x64' + py37-x86: + PYTHON_VERSION: '3.7' + PYTHON_ARCH: 'x86' + py37-x64: + PYTHON_VERSION: '3.7' PYTHON_ARCH: 'x64'