If you are thinking about making Mopidy better, or you just want to hack on it, that’s great. Here are some tips to get you started.
If you want to hack on Mopidy, you should run Mopidy directly from the Git repo.
Go to the Git repo root:
cd mopidy/
To get a mopidy executable and register all bundled extensions with setuptools, run:
python setup.py develop
It still works to run python mopidy directly on the mopidy Python package directory, but if you have never run python setup.py develop the extensions bundled with Mopidy isn’t registered with setuptools, so Mopidy will start without any frontends or backends, making it quite useless.
Now you can run the Mopidy command, and it will run using the code in the Git repo:
mopidy
If you do any changes to the code, you’ll just need to restart mopidy to see the changes take effect.
Mopidy has quite good test coverage, and we would like all new code going into Mopidy to come with tests.
To run tests, you need a couple of dependencies. They can be installed using pip:
pip install -r requirements/tests.txt
Then, to run all tests, go to the project directory and run:
nosetests
To run tests with test coverage statistics, remember to specify the tests dir:
nosetests --with-coverage tests/
Check the code for errors and style issues using flake8:
flake8 .
For more documentation on testing, check out the nose documentation.