# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

trigger:
- master

pool:
  vmImage: 'windows-latest'
strategy:
  matrix:
    Python36:
      python.version: '3.6'
      testgroup: 'python'
    Python36Extensions:
      python.version: '3.6'
      testgroup: 'nbextensions'

steps:
- task: UsePythonVersion@0
  inputs:
    versionSpec: '$(python.version)'
  displayName: 'Use Python $(python.version)'

- script: |
    python -m pip install --upgrade pip
    pip install -r dev-requirements.txt .
  displayName: 'Install dependencies'

- script: |
    jupyter nbextension install --sys-prefix --py nbgrader
    jupyter nbextension enable --sys-prefix --py nbgrader
    jupyter serverextension enable --sys-prefix --py nbgrader
  displayName: 'Install extensions'

- script: |
    python tasks.py tests --group=$(testgroup)
  displayName: 'Run tests'

# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

- cron: "0 12 * * 0"
  displayName: Weekly Sunday build
  branches:
    include:
    - releases/*
  always: true

pool:
  vmImage: 'windows-latest'
strategy:
  matrix:
    Python36:
      python.version: '3.6'
      testgroup: 'python'
    Python36Extensions:
      python.version: '3.6'
      testgroup: 'nbextensions'

steps:
- task: UsePythonVersion@0
  inputs:
    versionSpec: '$(python.version)'
  displayName: 'Use Python $(python.version)'

- script: |
    python -m pip install --upgrade pip
    pip install -r dev-requirements.txt .
  displayName: 'Install dependencies'

- script: |
    jupyter nbextension install --sys-prefix --py nbgrader
    jupyter nbextension enable --sys-prefix --py nbgrader
    jupyter serverextension enable --sys-prefix --py nbgrader
  displayName: 'Install extensions'

- script: |
    python tasks.py tests --group=$(testgroup)
  displayName: 'Run tests'

Add weekly cron as well
Add weekly cron as well
