|
| 1 | +# Python package |
| 2 | +# Create and test a Python package on multiple Python versions. |
| 3 | +# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: |
| 4 | +# https://docs.microsoft.com/azure/devops/pipelines/languages/python |
| 5 | + |
| 6 | +trigger: |
| 7 | +- master |
| 8 | + |
| 9 | +strategy: |
| 10 | + matrix: |
| 11 | + macos: |
| 12 | + python.version: "3.7" |
| 13 | + image.name: "macOS-10.14" |
| 14 | + miniconda.url: https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh |
| 15 | + linux: |
| 16 | + python.version: "3.7" |
| 17 | + image.name: "ubuntu-16.04" |
| 18 | + miniconda.url: https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh |
| 19 | + # windows: |
| 20 | + # python.version: "3.7" |
| 21 | + # image.name: "windows-2019" |
| 22 | + # miniconda.url: |
| 23 | + |
| 24 | +pool: |
| 25 | + vmImage: $(image.name) |
| 26 | + |
| 27 | +steps: |
| 28 | +- task: UsePythonVersion@0 |
| 29 | + inputs: |
| 30 | + versionSpec: '$(python.version)' |
| 31 | + displayName: 'Use Python $(python.version)' |
| 32 | + |
| 33 | +- script: | |
| 34 | + wget $(miniconda.url) -O miniconda.sh |
| 35 | + bash miniconda.sh -b -p $HOME/anaconda |
| 36 | + conda config --set always_yes yes --set changeps1 no |
| 37 | + conda update -q conda |
| 38 | + conda config --add channels conda-forge |
| 39 | +
|
| 40 | + # Install Python, py.test, and required packages. |
| 41 | + conda env create -f environment.yml |
| 42 | + source activate bayesian-modelling-tutorial |
| 43 | +
|
| 44 | + conda install python=$(python.version) |
| 45 | + python -m ipykernel install --user --name bayesian-modelling-tutorial |
| 46 | + displayName: 'Install dependencies' |
| 47 | + |
| 48 | +- script: | |
| 49 | + mkdir -p docs/notebooks |
| 50 | + jupyter nbconvert --config nbconvert_config.py --execute --template full |
| 51 | + pandoc README.md -o docs/index.html -c static/pandoc.css -s |
| 52 | + displayName: 'Build docs pages' |
0 commit comments