If you have questions about contributing code or suggestions for how to make contributing easier, please write to!forum/mido-community.

Installing for developers

To install the dev dependencies, you can run the command:

pip install -e .[dev]

This will install all needed dependencies for testing and documentation.


pytest is used for unit testing. The tests are found in mido/test_*.py.

Tests can be run using the command:


Before submission, it is required that the tox tests run and pass. Run the tox tests using:


It is required to test on at least 2.7 and 3.5 before submission. Any other passes are nice to have

You can also set up a commit hook:

echo "tox" >.git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

This will run tests when you commit and cancel the commit if any tests fail.

Testing MIDI file support

Test Files

The Lakh MIDI Dataset is a great resource for testing the MIDI file parser.

Publishing (Release Checklist)

I am currently the only one with access to publishing on PyPI and readthedocs. This will hopefully change in the future.

Bump Version

X.Y.Z is the version, for example 1.1.18 or 1.2.0.

  • update version and date in docs/changes.rst
  • update version in mido/
  • git commit -a -c “Bumped version to X.Y.Z.”

Publish on PyPI

I like to do this before I push to GitHub. This way if the package fails to upload I can roll back and fix it before I push my changes.

rm -rf dist/*

python bdist_wheel --universal
python sdist

twine upload twine upload dist/*

Push to GitHub

git tag X.Y.Z
git push
git push --tags

Update the stable branch (if this is a stable release):

git checkout stable
git pull . master
git push
git checkout master

Update Read the Docs

Log into and build the latest documentation. This is set up to use the stable branch.