https://github.com/lmfit/lmfit-py
Revision 60477b2511ef1c99fcad3b4d5134259dbb3c38ee authored by Martin Majlis on 13 March 2021, 06:20:05 UTC, committed by reneeotten on 26 March 2021, 02:16:17 UTC
1 parent 39bc25a
Raw File
Tip revision: 60477b2511ef1c99fcad3b4d5134259dbb3c38ee authored by Martin Majlis on 13 March 2021, 06:20:05 UTC
MAINT: update contributing guide
Tip revision: 60477b2
azure-pipelines.yml
# 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

stages:

- stage: check_codestyle
  jobs:
    - job: pre_commit
      pool:
        vmImage: 'ubuntu-latest'

      steps:
        - task: UsePythonVersion@0
          inputs:
            versionSpec: '3.9'
        - script: |
            python -m pip install --upgrade pip setuptools wheel
            pip install pre-commit
          displayName: 'Install Python dependencies'
        - script: |
            pre-commit autoupdate ; pre-commit run --all-files
          displayName: 'Run pre-commit hooks'

- stage: build_documentation
  jobs:
    - job: build_documentation
      pool:
        vmImage: 'ubuntu-latest'

      steps:
        - task: UsePythonVersion@0
          inputs:
            versionSpec: '3.9'
        - script: |
            python -m pip install --upgrade pip setuptools wheel
            pip install -r requirements-dev.txt
          displayName: 'Install Python dependencies'
        - script: |
            python setup.py install
          displayName: 'Install lmfit'
        - script: |
            sudo apt install -qq -y texlive-latex-extra latexmk
          displayName: 'Install TeX Live'
        - script: |
           cd doc ; make all
          displayName: 'Build the documentation'

- stage: tests_minimum_dependencies
  dependsOn: check_codestyle
  jobs:
    - job:
      pool:
        vmImage: 'ubuntu-latest'
      strategy:
        matrix:
          Python36:
            python.version: '3.6'
          Python37:
            python.version: '3.7'
          Python38:
            python.version: '3.8'
          Python39:
            python.version: '3.9'

      steps:
        - task: UsePythonVersion@0
          inputs:
            versionSpec: '$(python.version)'
          displayName: 'Use Python $(python.version)'
        - script: |
            sudo apt update && sudo apt install -yq --no-install-suggests --no-install-recommends \
            libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev ccache \
            swig libmpc-dev
          displayName: 'Install dependencies'
        - script: |
            python -m pip install --upgrade pip setuptools wheel
            pip install asteval==0.9.22 numpy==1.18 scipy==1.3.2 uncertainties==3.0.1 pytest coverage codecov
          displayName: 'Install minimum required version of dependencies'
        - script: |
            python setup.py install
          displayName: 'Install lmfit'
        - script: |
            pip list
          displayName: 'List installed Python packages'
        - script: |
            pip install pytest-azurepipelines pytest-cov
            coverage run --source=lmfit -m pytest
            coverage report -m
          displayName: 'Run test-suite and collect coverage'
        - script: |
            bash <(curl -s https://codecov.io/bash)
          displayName: 'Upload to codecov.io'

- stage: tests_latest_dependencies
  dependsOn: check_codestyle
  jobs:
    - job:
      pool:
        vmImage: 'ubuntu-latest'
      strategy:
        matrix:
          Python36:
            python.version: '3.6'
          Python37:
            python.version: '3.7'
          Python38:
            python.version: '3.8'
          Python39:
            python.version: '3.9'

      steps:
        - task: UsePythonVersion@0
          inputs:
            versionSpec: '$(python.version)'
          displayName: 'Use Python $(python.version)'
        - script: |
            sudo apt update && sudo apt install -yq --no-install-suggests --no-install-recommends \
            libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev ccache \
            swig libmpc-dev
          displayName: 'Install dependencies'
        - script: |
            python -m pip install --upgrade pip setuptools wheel
            pip install -r requirements-dev.txt
          displayName: 'Install latest available version of Python dependencies'
        - script: |
            python setup.py install
          displayName: 'Install lmfit'
        - script: |
            pip list
          displayName: 'List installed Python packages'
        - script: |
            pip install pytest-azurepipelines pytest-cov
            coverage run --source=lmfit -m pytest
            coverage report -m
          displayName: 'Run test-suite and collect coverage'
        - script: |
            bash <(curl -s https://codecov.io/bash)
          displayName: 'Upload to codecov.io'

- stage: development_version
  dependsOn: check_codestyle
  jobs:
    - job: Python310_dev
      pool:
        vmImage: 'ubuntu-latest'
      steps:
        - script: |
            sudo add-apt-repository ppa:deadsnakes/nightly
            sudo apt-get update
            sudo apt-get install -y --no-install-recommends python3.10-dev python3.10-distutils
          displayName: Install Python development version from the deadsnakes PPA
        - script: |
            sudo apt update && sudo apt install -yq --no-install-suggests --no-install-recommends \
            libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev ccache \
            swig libmpc-dev
          displayName: 'Install dependencies'
        - script: |
            export PATH=/home/vsts/.local/bin:$PATH
            curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
            python3.10 get-pip.py --user
            pip3.10 install -U pip setuptools wheel pybind11 cython
          displayName: 'Install pip, setuptools, wheel, pybind11, and cython'
        - script: |
            export PATH=/home/vsts/.local/bin:$PATH
            export numpy_version=1.20.1
            wget https://github.com/numpy/numpy/releases/download/v${numpy_version}/numpy-${numpy_version}.tar.gz
            tar xzvf numpy-${numpy_version}.tar.gz
            cd numpy-${numpy_version}
            python3.10 setup.py install --user
          displayName: 'Install latest available version of NumPy'
        - script: |
            export PATH=/home/vsts/.local/bin:$PATH
            export scipy_version=1.6.1
            wget https://github.com/scipy/scipy/releases/download/v${scipy_version}/scipy-${scipy_version}.tar.gz
            tar xzvf scipy-${scipy_version}.tar.gz
            cd scipy-${scipy_version}
            # force Cythonizing code in attempt to avoid "undefined symbol: _PyGen_Send" error
            rm -f PKG-INFO cythonize.dat
            python3.10 setup.py install --user
          displayName: 'Install latest available version of SciPy'
        - script: |
            export PATH=/home/vsts/.local/bin:$PATH
            pip3.10 install asteval uncertainties dill emcee numdifftools
          displayName: 'Install latest available version of Python dependencies'
        - script: |
            python3.10 setup.py install --user
          displayName: 'Install lmfit'
        - script: |
            export PATH=/home/vsts/.local/bin:$PATH
            pip3.10 list
          displayName: 'List installed Python packages'
        - script: |
            export PATH=/home/vsts/.local/bin:$PATH
            pip3.10 install pytest pytest-azurepipelines
            cd $(Agent.BuildDirectory)/s/tests
            pytest || echo -e "\043#vso[task.logissue type=warning;] Allowed failure for development version!!"
          displayName: 'Run test-suite'
back to top