Contributing

Contributions to pyspotify are welcome! Here are some tips to get you started hacking on pyspotify and contributing back your patches.

Development setup

  1. Make sure you have the following Python versions installed:

    • CPython 2.7
    • CPython 3.3
    • CPython 3.4
    • PyPy 2.6+
    • PyPy3 2.5+

    If you’re on Ubuntu, the Dead Snakes PPA has packages of both old and new Python versions.

  2. Install the following with development headers: Python, libffi, and libspotify.

    On Debian/Ubuntu, make sure you have apt.mopidy.com in your APT sources to get the libspotify package, then run:

    sudo apt-get install python-all-dev python3-all-dev libffi-dev libspotify-dev
    
  3. Create and activate a virtualenv:

    virtualenv ve
    source ve/bin/activate
    
  4. Install development dependencies:

    pip install -r dev-requirements.txt
    
  5. Run tests.

    For a quick test suite run, using the virtualenv’s Python version:

    py.test
    

    For a complete test suite run, using all the Python implementations:

    tox
    
  6. For some more development task helpers, install invoke:

    pip install invoke
    

    To list available tasks, run:

    invoke --list
    

    For example, to run tests on any file change, run:

    invoke test --watch
    

    Or, to build docs when any file changes, run:

    invoke docs --watch
    

    See the file tasks.py for the task definitions.

Submitting changes