Contributions to pyspotify are welcome! Here are some tips to get you started hacking on pyspotify and contributing back your patches.
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]
For a quick test suite run, using the virtualenv’s Python version:
For a complete test suite run, using all the Python implementations:
For some more development task helpers, install
pip install invoke
To list available tasks, run:
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.pyfor the task definitions.
- Code should be accompanied by tests and documentation. Maintain our excellent test coverage.
- Follow the existing code style, especially make sure
flake8does 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/masterbranch. See the GitHub pull request docs for help.