Contributing¶
Contributions to pyspotify are welcome! Here are some tips to get you started hacking on pyspotify and contributing back your patches.
Development setup¶
Make sure you have the following Python versions installed:
CPython 2.7
CPython 3.5
CPython 3.6
CPython 3.7
PyPy2.7 6.0+
PyPy3.5 6.0+
If you’re on Ubuntu, the Dead Snakes PPA has packages of both old and new Python versions.
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
Create and activate a virtualenv:
virtualenv ve source ve/bin/activate
Install development dependencies:
pip install -e ".[dev]
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
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¶
Code should be accompanied by tests and documentation. Maintain our excellent test coverage.
Follow the existing code style, especially make sure
flake8
does not complain about anything.Write good commit messages. Here’s three blog posts on how to do it right:
One branch per feature or fix. Keep branches small and on topic.
Send a pull request to the
v2.x/master
branch. See the GitHub pull request docs for help.