diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bfdb3d78..00000000 --- a/.travis.yml +++ /dev/null @@ -1,105 +0,0 @@ -# We set the language to c because python isn't supported on the MacOS X nodes -# on Travis. However, the language ends up being irrelevant anyway, since we -# install Python ourselves using conda. -language: c - -compiler: gcc - -os: - - linux - -# Setting sudo to false opts in to Travis-CI container-based builds. -sudo: false - -# The apt packages below are needed for sphinx builds. A full list of packages -# that can be included can be found here: -# -# https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise - -addons: - apt: - packages: - - graphviz - -env: - global: - # The following versions are the 'default' for tests, unless - # overridden underneath. They are defined here in order to save having - # to repeat them for all configurations. - - PYTHON_VERSION=3.7 - - NUMPY_VERSION=stable - - ASTROPY_VERSION=stable - - MAIN_CMD='python setup.py' - - SETUP_CMD='test' - - PIP_DEPENDENCIES='pytest-remotedata pytest-openfiles' - # For this package-template, we include examples of Cython modules, - # so Cython is required for testing. If your package does not include - # Cython code, you can set CONDA_DEPENDENCIES='' - - CONDA_DEPENDENCIES='Cython jinja2 scipy' - -matrix: - include: - - # Make sure that egg_info works without dependencies - - env: SETUP_CMD='egg_info' - - # Check for sphinx doc build warnings - we do this first because it - # may run for a long time - - env: PYTHON_VERSION=3.6 SETUP_CMD='build_docs -w' - - # Do a coverage test in Python 3. - - env: SETUP_CMD='test --coverage --open-files --remote-data' - PIP_DEPENDENCIES='codecov pytest-remotedata pytest-openfiles' - - # Do a test in older Python 3. - - env: PYTHON_VERSION=3.6 ASTROPY_VERSION=lts - SETUP_CMD='test --open-files' - - # Try Astropy development version - - env: ASTROPY_VERSION=development - - # Do a PEP8 test with flake8 - - env: MAIN_CMD='flake8 synphot --count' SETUP_CMD='' - -before_install: - - # If there are matplotlib tests, comment these out to - # Make sure that interactive matplotlib backends work - # - export DISPLAY=:99.0 - # - sh -e /etc/init.d/xvfb start - -install: - - # We now use the ci-helpers package to set up our testing environment. - # This is done by using Miniconda and then using conda and pip to install - # dependencies. Which dependencies are installed using conda and pip is - # determined by the CONDA_DEPDENDENCIES and PIP_DEPENDENCIES variables, - # which should be space-delimited lists of package names. See the README - # in https://github.com/astropy/ci-helpers for information about the full - # list of environment variables that can be used to customize your - # environment. In some cases, ci-helpers may not offer enough flexibility - # in how to install a package, in which case you can have additional - # commands in the install: section below. - - - git clone git://github.com/astropy/ci-helpers.git - - source ci-helpers/travis/setup_conda.sh - - # Upgrade to the latest version of pip to avoid it displaying warnings - # about it being out of date. - #- pip install --upgrade --no-deps pip - - # As described above, using ci-helpers, you should be able to set up an - # environment with dependencies installed using conda and pip, but in some - # cases this may not provide enough flexibility in how to install a - # specific dependency (and it will not be able to install non-Python - # dependencies). Therefore, you can also include commands below (as - # well as at the start of the install section or in the before_install - # section if they are needed before setting up conda) to install any - # other dependencies. - -script: - - $MAIN_CMD $SETUP_CMD - -after_success: - # Coverage report. - - if [[ $SETUP_CMD == *--coverage* ]]; then codecov; fi diff --git a/README.rst b/README.rst index 857e0e70..fee3f091 100644 --- a/README.rst +++ b/README.rst @@ -9,14 +9,6 @@ synphot :target: https://dev.azure.com/spacetelescope/synphot_refactor/_build/latest?definitionId=2&branchName=master :alt: Azure CI Status -.. image:: https://travis-ci.org/spacetelescope/synphot_refactor.svg?branch=master - :target: https://travis-ci.org/spacetelescope/synphot_refactor - :alt: Travis CI Status - -.. image:: https://ci.appveyor.com/api/projects/status/jc4f77cpng8iyvnd/branch/master?svg=true - :target: https://ci.appveyor.com/project/pllim/synphot-refactor/branch/master - :alt: Appveyor CI Status - .. image:: https://codecov.io/gh/spacetelescope/synphot_refactor/branch/master/graph/badge.svg :target: https://codecov.io/gh/spacetelescope/synphot_refactor :alt: Coverage results diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index d694758c..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,44 +0,0 @@ -# AppVeyor.com is a Continuous Integration service to build and run tests under -# Windows - -environment: - - global: - PYTHON: "C:\\conda" - MINICONDA_VERSION: "latest" - CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci-helpers\\appveyor\\windows_sdk.cmd" - PYTHON_ARCH: "64" # needs to be set for CMD_IN_ENV to succeed. If a mix - # of 32 bit and 64 bit builds are needed, move this - # to the matrix section. - # For this package-template, we include examples of Cython modules, - # so Cython is required for testing. If your package does not include - # Cython code, you can set CONDA_DEPENDENCIES='' - #CONDA_DEPENDENCIES: "Cython" - CONDA_DEPENDENCIES: "Cython jinja2 scipy" - - matrix: - - # We test 3.7 only - - PYTHON_VERSION: "3.7" - ASTROPY_VERSION: "stable" - NUMPY_VERSION: "stable" - -platform: - -x64 - -install: - - "git clone git://github.com/astropy/ci-helpers.git" - - "powershell ci-helpers/appveyor/install-miniconda.ps1" - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - - "activate test" - - # Upgrade to the latest version of pip to avoid it displaying warnings - # about it being out of date. - #- "python -m pip install --upgrade pip" - -# Not a .NET project, we build the package in the install step instead -build: false - -test_script: - #- "%CMD_IN_ENV% python setup.py test --remote-data" - - "%CMD_IN_ENV% python setup.py test" diff --git a/azure-cron.yml b/azure-cron.yml new file mode 100644 index 00000000..22dd9cfc --- /dev/null +++ b/azure-cron.yml @@ -0,0 +1,7 @@ +trigger: +- master + +jobs: + - template: azure-templates.yml + parameters: + name: 'Nightly' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 01639544..c9400170 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,88 +1,107 @@ -# 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 -jobs: -- job: 'EggInfo' - pool: - vmImage: 'Ubuntu-16.04' - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.x' - architecture: 'x64' - - # 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: 'Test' - pool: - vmImage: 'Ubuntu-16.04' - strategy: - matrix: - Python37: - python.version: '3.7' - maxParallel: 4 - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - architecture: 'x64' - - - script: | - sudo apt-get install libxml2-utils - python -m pip install --upgrade pip setuptools - pip install numpy scipy astropy pytest-astropy - python setup.py test - displayName: 'Run tests' - -- job: 'Doc' - pool: - vmImage: 'Ubuntu-16.04' - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.6' - architecture: 'x64' - - - script: | - sudo apt-get install graphviz - python -m pip install --upgrade pip setuptools - pip install numpy scipy matplotlib astropy sphinx-astropy - 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' - -- job: 'PEP8' - pool: - vmImage: 'Ubuntu-16.04' - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.x' - architecture: 'x64' - - - script: | - python -m pip install --upgrade pip setuptools - pip install flake8 - flake8 synphot --count - displayName: 'PEP 8 check' +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 + + - script: | + sudo apt-get install libxml2-utils + python -m pip install --upgrade pip setuptools + pip install numpy scipy astropy pytest-astropy codecov + python setup.py test --coverage --open-files --remote-data + 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' + + - 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 matplotlib astropy sphinx-astropy + 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' diff --git a/azure-templates.yml b/azure-templates.yml new file mode 100644 index 00000000..fa26e420 --- /dev/null +++ b/azure-templates.yml @@ -0,0 +1,28 @@ +parameters: + name: 'Default' # Defaults for any parameters that aren't specified + vmImage: 'Ubuntu-16.04' + numpyCmd: 'pip install numpy' + astropyCmd: 'pip install astropy' + pythonVersion: '3.7' + +jobs: +- job: ${{ parameters.name }} + pool: + vmImage: ${{ parameters.vmImage }} + strategy: + maxParallel: 4 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: ${{ parameters.pythonVersion }} + architecture: 'x64' + + - script: | + sudo apt-get install libxml2-utils + python -m pip install --upgrade pip setuptools + ${{ parameters.numpyCmd }} + pip install scipy pytest-astropy + ${{ parameters.astropyCmd }} + python setup.py test --open-files + displayName: 'Run tests'