Skip to content

Commit

Permalink
DO NOT MERGE: Test astropy 4 models
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim committed Jun 18, 2019
1 parent 92bb986 commit 404599f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 126 deletions.
127 changes: 19 additions & 108 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,111 +3,22 @@
trigger:
- master

stages:
- stage: Initial
jobs:
- job: 'EggInfo'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0

# Make sure that egg_info works without dependencies
- script: |
python -m pip install --upgrade pip setuptools
python setup.py egg_info
displayName: 'egg_info'
- job: 'PEP8'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'

- script: |
python -m pip install --upgrade pip setuptools
pip install flake8
flake8 synphot --count
displayName: 'PEP 8 check'
- template: azure-templates.yml

- stage: Comprehensive
dependsOn: Initial
condition: succeeded()
jobs:
- job: 'Coverage'
pool:
vmImage: 'Ubuntu-16.04'
strategy:
maxParallel: 4

steps:
- task: UsePythonVersion@0

# NOTE: If CDBS cannot take the hit, disable --remote-data
- script: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools
pip install numpy scipy beautifulsoup4 astropy pytest-astropy synphot codecov
python setup.py test --coverage --open-files --remote-data
env:
PYSYN_CDBS: $(PYSYN_CDBS)
displayName: 'Run tests'
- script: codecov -t $codecov_token
env:
codecov_token: $(CODECOV_TOKEN)
displayName: 'Calculate coverage'

- template: azure-templates.yml
parameters:
name: 'LTS_Astropy'
numpyCmd: 'pip install numpy==1.15.4'
astropyCmd: 'pip install astropy==2.0.12'
pythonVersion: '3.6'

- template: azure-templates.yml
parameters:
name: 'Dev_Astropy'
astropyCmd: 'pip install git+https://github.com/astropy/astropy.git@master#egg=astropy'
synphotCmd: 'pip install git+https://github.com/spacetelescope/synphot_refactor.git@master#egg=synphot'

- template: azure-templates.yml
parameters:
name: 'Windows'
vmImage: 'vs2017-win2016'

- template: azure-templates.yml
parameters:
name: 'OSX'
vmImage: 'macOS-10.13'

- job: 'Doc'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'

- script: |
sudo apt-get install graphviz
python -m pip install --upgrade pip setuptools
pip install numpy scipy beautifulsoup4 matplotlib astropy sphinx-astropy synphot
python setup.py build_docs -w
displayName: 'Doc build'
# DEV NOTE:
# Not very useful like this because I have to sign in with Microsoft account,
# download a ZIP file, unzip on local disk, and then only I can preview the
# HTML pages. Was hoping for direct preview by clicking URL like CircleCI.
#
# - task: PublishPipelineArtifact@0
# inputs:
# artifactName: 'htmlDocs'
# targetPath: 'docs/_build/html'
jobs:
- template: azure-templates.yml

- template: azure-templates.yml
parameters:
name: 'Older_Versions'
numpyCmd: 'pip install numpy==1.14.6'
scipyCmd: 'pip install scipy==1.1.0'
pythonVersion: '3.6'

- template: azure-templates.yml
parameters:
name: 'Windows'
vmImage: 'vs2017-win2016'

- template: azure-templates.yml
parameters:
name: 'OSX'
vmImage: 'macOS-10.13'
24 changes: 6 additions & 18 deletions azure-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ parameters:
name: 'Default' # Defaults for any parameters that aren't specified
vmImage: 'Ubuntu-16.04'
numpyCmd: 'pip install numpy'
astropyCmd: 'pip install astropy'
synphotCmd: 'pip install synphot'
scipyCmd: 'pip install scipy'
astropyCmd: 'pip install git+https://github.com/perrygreenfield/astropy.git@modeling-rebase-2-dataunit#egg=astropy'
synphotCmd: 'pip install git+https://github.com/spacetelescope/synphot_refactor.git@master#egg=synphot'
pythonVersion: '3.7'
pytestExtraArgs: ''

jobs:
- job: ${{ parameters.name }}
Expand All @@ -22,27 +22,15 @@ jobs:
versionSpec: ${{ parameters.pythonVersion }}
architecture: 'x64'

- bash: |
export PYTEST_EXTRA_ARGS=${{ parameters.pytestExtraArgs }}
echo "##vso[task.setvariable variable=PYTEST_EXTRA_ARGS]$PYTEST_EXTRA_ARGS"
condition: ne( variables['Agent.OS'], 'Windows_NT' )
displayName: Set var on Linux/Darwin
# Disable --remote-data for Windows regardless of pytestExtraArgs
- powershell: |
Set-Variable -Name PYTEST_EXTRA_ARGS -Value ''
Write-Host "##vso[task.setvariable variable=PYTEST_EXTRA_ARGS]$PYTEST_EXTRA_ARGS"
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: Set var on Windows
- script: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools
${{ parameters.numpyCmd }}
pip install scipy beautifulsoup4 pytest-astropy
${{ parameters.scipyCmd }}
pip install beautifulsoup4 pytest-astropy
${{ parameters.astropyCmd }}
${{ parameters.synphotCmd }}
python setup.py test --open-files $(PYTEST_EXTRA_ARGS)
python setup.py test --open-files --remote-data
env:
PYSYN_CDBS: $(PYSYN_CDBS)
displayName: 'Run tests'

0 comments on commit 404599f

Please sign in to comment.