Coverage Installation Hints for macOS Users:

venv

Here we will be using venv, which is part of python’s standardlibary since python 3.3, to create a virtualenv for development.

1. Make sure you have installed Xcode and Homebrew.

2. Install Python 3.

For coala you will need to use Python 3, so you maysimply use homebrew to install Python 3, or you could alsorefer to the pyenv section to install Python 3 while you can alsomaintain other python versions.

  1. $ brew search python # This should display Python 3
  2. $ brew install python3
  3. $ python3 --version # To check the installed version

3. Create Virtual Environments with venv

  1. # Create Virtual Env named myenv
  2. $ python3 -m venv myenv
  3.  
  4. # This will create a folder named myenv in the
  5. # current directory. To activate this environment just type
  6. $ source myenv/bin/activate
  7.  
  8. # You can start Python 3 by typing:
  9. $ python

4. Virtualenvwrapper with Python 3:

  1. # Installation
  2. $ pip3 install virtualenv
  3. $ pip3 install virtualenvwrapper
  4.  
  5. # Folder to contain Virtual Environments
  6. $ mkdir ~/.virtualenvs
  7.  
  8. # Add the following in ~/.bash_profile
  9. $ export WORKON_HOME=~/.virtualenvs
  10. $ source /usr/local/bin/virtualenvwrapper.sh
  11.  
  12. # Activate Changes
  13. $ source ~/.bash_profile
  14.  
  15. # Get Python 3 path (python3_pth)
  16. $ which python3
  17.  
  18. # Create a new virtual environment with Python 3
  19. $ mkvirtualenv --python=python3_path myenv

Finally!

  1. # Install python-coverage3 by
  2. $ easy_install coverage

pyenv

Here we show how to use pyenv, which is simply a python installerthat allows you to install multiple python versions and switchthrough them. After installation, you may also want to set upa virtual environment using venv or virtualenv.

1. Install pyenv with homebrew

  1. $ brew update
  2. $ brew install pyenv

2. Installing and using python with pyenv

To install python you simply have todo this (you don’t have to install all of them) :

  1. $ pyenv install 3.5.0
  2. $ pyenv install 3.4.3
  3. $ pyenv install 3.3.6
  4. $ pyenv install 3.2.6
  5. $ pyenv install 2.7.10
  6. $ pyenv versions # lists the versions you have

To use a particular version you simply have to do this :

  1. $ pyenv local 3.5.0

To know more about the available pyenv commands, pleaseread their Command Reference.

Presently, while using pyenv, tests for version-file-read fail,if interested you canhave a look here.