-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Use miniconda for dependencies on Travis #3273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,12 +6,14 @@ env: | |
| - secure: E7OCdqhZ+PlwJcn+Hd6ns9TDJgEUXiUNEI0wu7xjxB2vBRRIKtZMbuaZjd+iKDqCKuVOJKu0ClBUYxmgmpLicTwi34CfTUYt6D4uhrU+8hBBOn1iiK51cl/aBvlUUrqaRLVhukNEBGZcyqAjXSA/Qsnp2iELEmAfOUa92ZYo1sk= | ||
| - BUILD_DOCS=false | ||
| - TEST_ARGS=--no-pep8 | ||
| - NUMPY_VERSION=1.9 | ||
|
|
||
| language: python | ||
|
|
||
| matrix: | ||
| include: | ||
| - python: 2.6 | ||
| env: NUMPY_VERSION=1.6 | ||
| - python: 2.7 | ||
| - python: 3.3 | ||
| - python: 3.4 | ||
|
|
@@ -20,12 +22,35 @@ matrix: | |
| - python: 2.7 | ||
| env: BUILD_DOCS=true | ||
|
|
||
| before_install: | ||
| # Download and install conda | ||
| - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh | ||
| - chmod +x miniconda.sh | ||
| - ./miniconda.sh -b | ||
| - export PATH=/home/travis/miniconda/bin:$PATH | ||
| - conda update --yes conda | ||
|
|
||
|
|
||
| install: | ||
| - pip install -q --use-mirrors nose python-dateutil numpy pep8 pyparsing pillow | ||
| - sudo apt-get update && sudo apt-get -qq install inkscape libav-tools | ||
| # We use --no-install-recommends to avoid pulling in additional large latex docs that we don't need | ||
| - if [[ $BUILD_DOCS == true ]]; then sudo apt-get install -qq --no-install-recommends dvipng texlive-latex-base texlive-latex-extra texlive-fonts-recommended graphviz; fi | ||
| - if [[ $BUILD_DOCS == true ]]; then pip install sphinx numpydoc linkchecker; fi | ||
| # Set up Conda environment | ||
| - conda create --yes -n test python=$TRAVIS_PYTHON_VERSION | ||
| - source activate test | ||
|
|
||
| # Install core Python dependencies using conda | ||
| - conda install --yes nose dateutil numpy=$NUMPY_VERSION pep8 pyparsing pillow | ||
|
|
||
| # Install some non-Python dependencies through apt-get | ||
| - sudo apt-get update | ||
| - sudo apt-get -qq install inkscape libav-tools | ||
| # We use --no-install-recommends to avoid pulling in additional large latex docs that we don't need | ||
| - | | ||
| if [[ $BUILD_DOCS == true ]]; then | ||
| sudo apt-get install -qq --no-install-recommends dvipng texlive-latex-base texlive-latex-extra texlive-fonts-recommended graphviz; | ||
| conda install --yes sphinx numpydoc; | ||
| pip install linkchecker; | ||
| fi | ||
|
|
||
| # Now, install matplotlib | ||
| - python setup.py install | ||
|
|
||
| script: | ||
|
|
@@ -36,16 +61,25 @@ script: | |
| # Generate the font caches in a single process before starting the | ||
| # multiple processes | ||
| - python -c "from matplotlib import font_manager" | ||
| - if [[ $BUILD_DOCS == false ]]; then mkdir ../tmp_test_dir; fi | ||
| - if [[ $BUILD_DOCS == false ]]; then cd ../tmp_test_dir; fi | ||
| - if [[ $BUILD_DOCS == false ]]; then python ../matplotlib/tests.py -sv --processes=8 --process-timeout=300 $TEST_ARGS; fi | ||
| - if [[ $BUILD_DOCS == true ]]; then cd doc; python make.py html --small; fi | ||
| # We don't build the LaTeX docs here, so linkchecker will complain | ||
| - if [[ $BUILD_DOCS == true ]]; then touch build/html/Matplotlib.pdf; fi | ||
| - if [[ $BUILD_DOCS == true ]]; then linkchecker build/html/index.html; fi | ||
| - | | ||
| if [[ $BUILD_DOCS == false ]]; then | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 on making these readable! |
||
| mkdir ../tmp_test_dir; | ||
| cd ../tmp_test_dir; | ||
| python ../matplotlib/tests.py -sv --processes=8 --process-timeout=300 $TEST_ARGS; | ||
| else | ||
| cd doc; python make.py html --small; | ||
| # We don't build the LaTeX docs here, so linkchecker will complain | ||
| touch build/html/Matplotlib.pdf; | ||
| linkchecker build/html/index.html; | ||
| fi | ||
|
|
||
| after_failure: | ||
| - tar cjf result_images.tar.bz2 result_images | ||
| - if [[ $TRAVIS_PULL_REQUEST == false ]]; then gem install travis-artifacts; fi | ||
| - if [[ $TRAVIS_PULL_REQUEST == false ]]; then travis-artifacts upload --path result_images.tar.bz2; fi | ||
| - if [[ $TRAVIS_PULL_REQUEST != false ]]; then echo "The result images will only be uploaded if they are on the matplotlib/matplotlib repo - this is for security reasons to prevent arbitrary PRs echoing security details." else echo https://s3.amazonaws.com/matplotlib-test-results/artifacts/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/result_images.tar.bz2; fi | ||
| - | | ||
| if [[ $TRAVIS_PULL_REQUEST == false ]]; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't a PR also change the travis configuration?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it is a PR build the private artifacts just are not available so the upload to AWS will fail, this just skips bundling them up and trying the upload if we know it will fail. A malicious PR can change this, but it will just waste cycles on travis. |
||
| tar cjf result_images.tar.bz2 result_images; | ||
| gem install travis-artifacts; fi | ||
| travis-artifacts upload --path result_images.tar.bz2; | ||
| echo https://s3.amazonaws.com/matplotlib-test-results/artifacts/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/result_images.tar.bz2; | ||
| else | ||
| echo "The result images will only be uploaded if they are on the matplotlib/matplotlib repo - this is for security reasons to prevent arbitrary PRs echoing security details." | ||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~~ The alarm bells are ringing. 🚨 Shouldn't this be controlled by an environment variable ~~
Scrap that - I remember now that $TRAVIS_PYTHON_VERSION is set by travis, and that with travis you can control the full python environment with the "python" setting/thingy. I've clearly got too used to using the environment matrix to control environment variables.