-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from mcg1969/simplify-ci
CI simplification; use conda build
- Loading branch information
Showing
10 changed files
with
129 additions
and
222 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,43 @@ | ||
# https://travis-ci.org/Anaconda-Platform/anaconda-project/ | ||
|
||
# language: python sets up virtualenv and pip that we don't need. | ||
# omitting language gives us ruby stuff. c seems likely to be a minimal setup. | ||
# Don't use language: python; this gives us an unnecessary virtualenv | ||
language: c | ||
# this is here to avoid a hang with python 2.7, suggested in | ||
# Seems to be needed to prevent hanging in Python 2.7 | ||
# https://github.com/travis-ci/travis-ci/issues/6861 | ||
sudo: required | ||
|
||
env: | ||
# All supported python versions | ||
- MINICONDA_VERSION=latest TRAVIS_PYTHON_VERSION=2.7 TEST_TARGET=tests CONDA_CANARY=false | ||
- MINICONDA_VERSION=latest TRAVIS_PYTHON_VERSION=3.6 TEST_TARGET=tests CONDA_CANARY=false | ||
- MINICONDA_VERSION=latest TRAVIS_PYTHON_VERSION=3.7 TEST_TARGET=tests CONDA_CANARY=false | ||
# Can build the package | ||
- MINICONDA_VERSION=latest TRAVIS_PYTHON_VERSION=3.7 TEST_TARGET=packaging CONDA_CANARY=false | ||
# conda canary | ||
- MINICONDA_VERSION=latest TRAVIS_PYTHON_VERSION=3.7 TEST_TARGET=tests CONDA_CANARY=true | ||
# Build and test package on all supported python version | ||
- BUILD_TARGET=3.7 | ||
- BUILD_TARGET=3.6 | ||
- BUILD_TARGET=2.7 | ||
# Smoketest package on conda canary | ||
- BUILD_TARGET=3.7 CONDA_CANARY="-c conda-canary" | ||
|
||
os: | ||
- linux | ||
- osx | ||
|
||
matrix: | ||
# disable all but one job on OS X, we just want to smoke test OS X. | ||
exclude: | ||
- os: osx | ||
env: MINICONDA_VERSION=latest TRAVIS_PYTHON_VERSION=2.7 TEST_TARGET=tests CONDA_CANARY=false | ||
- os: osx | ||
env: MINICONDA_VERSION=latest TRAVIS_PYTHON_VERSION=3.6 TEST_TARGET=tests CONDA_CANARY=false | ||
- os: osx | ||
env: MINICONDA_VERSION=latest TRAVIS_PYTHON_VERSION=3.7 TEST_TARGET=packaging CONDA_CANARY=false | ||
# conda canary shouldn't block the build, just show us an FYI | ||
allow_failures: | ||
# conda canary shouldn't block the build, just show us an FYI | ||
- env: MINICONDA_VERSION=latest TRAVIS_PYTHON_VERSION=3.7 TEST_TARGET=tests CONDA_CANARY=true | ||
- env: BUILD_TARGET=3.7 CONDA_CANARY="-c conda-canary" | ||
|
||
install: | ||
- printenv | sort | ||
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then | ||
MINICONDA_PYVERSION=2 ; | ||
else | ||
MINICONDA_PYVERSION=3 ; | ||
fi ; | ||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
MINICONDA_OS=Linux ; | ||
else | ||
MINICONDA_OS=MacOSX ; | ||
fi ; | ||
echo "Fetching Python $MINICONDA_PYVERSION miniconda for $MINICONDA_OS" ; | ||
wget https://repo.continuum.io/miniconda/Miniconda$MINICONDA_PYVERSION-$MINICONDA_VERSION-$MINICONDA_OS-x86_64.sh -O miniconda.sh | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then MINICONDA_OS=Linux; else MINICONDA_OS=MacOSX; fi | ||
- wget https://repo.anaconda.com/miniconda/Miniconda3-latest-$MINICONDA_OS-x86_64.sh -O miniconda.sh | ||
- bash miniconda.sh -b -p "$HOME"/miniconda | ||
- source "$HOME"/miniconda/bin/activate root | ||
- printenv | sort | ||
- source "$HOME"/miniconda/etc/profile.d/conda.sh | ||
- conda config --set always_yes yes --set changeps1 no --set auto_update_conda false | ||
# Use the latest conda | ||
- conda update conda --no-pin -q | ||
- if test x"$CONDA_CANARY" = xtrue ; then conda update -n root -c conda-canary conda; fi | ||
- conda install -n root conda-build psutil | ||
# yapf is pinned to help make sure we get the same results here as a user does locally. | ||
- conda install -q $CONDA_CANARY -c defaults -c conda-forge conda conda-build conda-verify codecov flake8 pep257 yapf==0.25.0 | ||
- conda info -a | ||
# we don't use environment.yml in here because I'm not sure how to parameterize the | ||
# Python version and OS version in it. If we switch to being recursive and use | ||
# anaconda-project.yml instead of environment.yml there's a way to do that though. | ||
# Adding conda-forge as a lower-priority channel to pick up a few packages | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
OS_PACKAGES=libffi ; | ||
fi ; | ||
conda create -q -n test-environment -c defaults -c conda-forge | ||
python="$TRAVIS_PYTHON_VERSION" coverage tornado=4 pytest pytest-cov | ||
pip redis notebook bokeh ruamel_yaml anaconda-client requests psutil | ||
flake8 pep257 yapf keyring $OS_PACKAGES | ||
- source activate test-environment | ||
- unset CONDA_ENV_PATH # because the older conda in miniconda sets this, confusing some tests | ||
- export PATH=`echo "$PATH" | sed -e s@"$HOME"/miniconda/bin:@@g` | ||
- export LANG=en_US.UTF-8 | ||
- export COVERAGE_DIR=":$HOME/htmlcov" | ||
- printenv | sort | ||
|
||
script: | ||
- if test "$TEST_TARGET" = tests; then | ||
LANG=en_US.UTF-8 python scripts/run_tests.py --pytest-args ' -vv'; | ||
fi | ||
- if test "$TRAVIS_PYTHON_VERSION" = "3.5" && test "$TEST_TARGET" = "packaging"; then | ||
git fetch --unshallow ; | ||
LANG=en_US.UTF-8 python scripts/create_conda_packages.py; | ||
else | ||
echo "Not building packages on $TRAVIS_PYTHON_VERSION target=$TEST_TARGET" ; | ||
fi | ||
- conda build conda.recipe --python=$BUILD_TARGET | ||
- conda activate | ||
- python scripts/run_tests.py --format-only | ||
|
||
after_success: | ||
- conda install -q -n test-environment -c conda-forge codecov | ||
- codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,37 @@ | ||
# https://ci.appveyor.com/project/ContinuumAnalytics/anaconda-project-fqvvy/ | ||
# Build only the master branch, tagged commits, and pull requests | ||
branches: | ||
only: | ||
- master | ||
- /\d+\.\d+.*/ | ||
|
||
# Don't run the (redundant) branch build with a pull request | ||
skip_branch_with_pr: true | ||
|
||
matrix: | ||
fast_finish: true | ||
|
||
environment: | ||
global: | ||
PYTHON: "C:\\conda" | ||
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. | ||
PYTHONUNBUFFERED: 1 | ||
COVERAGE_DIR: "" | ||
MINICONDA: C:\\Miniconda3-x64 | ||
matrix: | ||
- PYTHON_VERSION: "2.7" | ||
- PYTHON_VERSION: "3.6" | ||
- PYTHON_VERSION: "3.7" | ||
|
||
platform: | ||
-x64 | ||
- PYTHON_VERSION: 3.7 | ||
- PYTHON_VERSION: 3.6 | ||
- PYTHON_VERSION: 2.7 | ||
|
||
install: | ||
- if "%PYTHON_VERSION%" == "3.6" set "BASE_PYTHON_VERSION=36" | ||
- if "%PYTHON_VERSION%" == "3.7" set "BASE_PYTHON_VERSION=3" | ||
- if "%PYTHON_ARCH%" == "64" set "ARCH_LABEL=-x64" | ||
# These are already installed on appveyor. Update them. | ||
- set "CONDA_ROOT=C:\Miniconda%BASE_PYTHON_VERSION%%ARCH_LABEL%" | ||
# we can't "activate root" with sufficiently-old conda which appveyor has (?) | ||
# - "%CONDA_ROOT%\\Scripts\\activate root" | ||
- set "PATH=%CONDA_ROOT%;%CONDA_ROOT%\Scripts;%CONDA_ROOT%\Library\bin;%PATH%" | ||
- set PATH | ||
- echo CONDA_PREFIX %CONDA_PREFIX% | ||
- conda config --set always_yes yes | ||
- conda config --add channels conda-forge --add channels defaults | ||
# Use the latest conda | ||
- conda install -n root -q conda --no-pin | ||
# activate with newer conda, may set different variables | ||
- "%CONDA_ROOT%\\Scripts\\activate root" | ||
- echo CONDA_PREFIX %CONDA_PREFIX% | ||
# conda 4.5.11 seems to expect that this directory exists already | ||
- mkdir C:\Users\appveyor\.conda | ||
- call %MINICONDA%\Scripts\activate.bat | ||
# The safety checks are simply intended to ensure that there is enough disk space | ||
# and the user has the necessary permissions to make environment changes. In a CI | ||
# environment these are not necessary and slow things down noticeably on Windows. | ||
- conda config --set always_yes yes --set changeps1 no --set auto_update_conda no --set safety_checks disabled | ||
- conda install -q conda conda-build conda-verify | ||
- conda info -a | ||
- conda create -q -n test-environment python=%PYTHON_VERSION% keyring pip notebook bokeh ruamel_yaml anaconda-client requests tornado coverage pytest pytest-cov pep257 flake8 yapf | ||
|
||
# Not a .NET project, we build in the install step instead | ||
build: false | ||
|
||
test_script: | ||
- echo CONDA_PREFIX %CONDA_PREFIX% | ||
- "%CONDA_ROOT%\\Scripts\\activate test-environment" | ||
- echo CONDA_PREFIX %CONDA_PREFIX% | ||
- echo PATH %PATH% | ||
- conda list | ||
- conda info -a | ||
- python -c "import sys; print(sys.version)" | ||
- python -c "import sys; print(sys.executable)" | ||
- python -c "import sys; print(sys.prefix)" | ||
- python --version | ||
- python scripts/run_tests.py | ||
- conda build conda.recipe --python=%PYTHON_VERSION% |
Oops, something went wrong.