Test Python with Miniconda on OS X and Linux with travis-ci

Travis has long been language: python OSX build is broken so I have to fight with language: c It doesn't become.

There is an actual yml at https://github.com/chezou/fastFM/blob/travis-conda/.travis.yml, I usually write like this.

It feels like writing a Python version in env.

.travis.yml


language: c

env:
    - TRAVIS_PYTHON_VERSION="2.7"
    - TRAVIS_PYTHON_VERSION="3.5"

os:
    - linux
    - osx

before_install:
    - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
    - # install some brew package
    - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq;  fi
    - # install some apt package
    - if [[ "$TRAVIS_PYTHON_VERSION" =~ "^2" ]]; then
        if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
          wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
        else
          wget https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh -O miniconda.sh;
        fi
      else
        if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
          wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
        else
          wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
        fi
      fi
    - bash miniconda.sh -b -p $HOME/miniconda
    - export PATH="$HOME/miniconda/bin:$PATH"
    - hash -r
    - conda config --set always_yes yes --set changeps1 no
    - conda update -q conda
    # Useful for debugging any issues with conda
    - conda info -a
    - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION # some needed packages
    - source activate test-environment

install:
    - pip install .

script:
    - nosetests

It's painful, but testing the code used with Cython takes 20 minutes for CI without Miniconda, so it can't be helped.

Recommended Posts

Test Python with Miniconda on OS X and Linux with travis-ci
Install lp_solve on Mac OS X and call it with python.
Word Count with Apache Spark and python (Mac OS X)
Install Python 2.7.9 and Python 3.4.x with pip.
Get started with the Python framework Django on Mac OS X
Quickly install OpenCV 2.4 (+ python) on OS X and try the sample
[C] [python] Read with AquesTalk on Linux
I'm using tox and Python 3.3 with Travis-CI
Installing PIL with Python 3.x on macOS
Put OpenCV in OS X with Homebrew and input / output video with python
Put MeCab binding for Python with pip on Windows, mac and Linux
Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
Run Zookeeper x python (kazoo) on Mac OS X
Put Python 2.7.x on Mac OSX 10.15.5 with pyenv
Install shogun with python modular (OS X Yosemite)
Shpinx (Python documentation builder) on Mac OS X
I installed Pygame with Python 3.5.1 in the environment of pyenv on OS X
Primality test with Python
OS and Linux distribution
Primality test with python
Notes on HDR and RAW image processing with Python
Yum command to access MySQL with Python 3 on Linux
How to install caffe on OS X with macports
Automatic follow on Twitter with python and selenium! (RPA)
Set up Docker on Oracle Linux (7.x) with Vagrant
Get comments on youtube Live with [python] and [pytchat]!
Build a Python development environment on Mac OS X
Install PyQt5 with homebrew on Mac OS X Marvericks (10.9.2)
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python
MySQL installation on Aws Linux 2 and test data preparation
Compile and install MySQL-python for python2.7 on amazon linux
Email hipchat with postfix, fluentd and python on Azure
Automate Chrome with Python and Selenium on your Chromebook
Create a Python development environment on OS X Lion
Programming with Python and Tkinter
Design and test Verilog in Python only with Veriloggen and cocotb.
Encryption and decryption with Python
Using multiple versions of Python on Mac OS X (2) Usage
Python on Ruby and angry Ruby on Python
Using NAOqi 2.4.2 Python SDK on Mac OS X El Capitan
Create an LCD (16x2) game with Raspberry Pi and Python
Recording and playback on Linux
IP spoof using tor on macOS and check with python
Put Python 3.x on Ubuntu
Run Tensorflow 2.x on Python 3.7
Python debug and test module
Build a python environment with pyenv (OS X El Capitan 10.11.3)
Build Python3 for Windows 10 on ARM with Visual Studio 2019 (x86) on Windows 10 on ARM
Memo on Mac OS X
python with pyenv and venv
Notes on deploying pyenv with Homebrew and managing Python versions
[Python x Zapier] Get alert information and notify with Slack
How to install Theano on Mac OS X with homebrew
About Python and os operations
Works with Python and R
Create AtCoder Contest appointments on Google Calendar with Python and GAS
Using multiple versions of Python on Mac OS X (1) Multiple Ver installation
Build a Python environment on your Mac with Anaconda and PyCharm
Error and solution when installing python3 with homebrew on mac (catalina 10.15)
Linking Python and Arduino to display IME On / Off with LED
Continuation ・ Notes on preparing the Python development environment on Mac OS X