First use the virtualenv command workon mopidy
to switch to your development workspace and then clone a copy of mopidy sources from GitHub. Use the git branch
command to check you are on a development branch. Finally cd
to the mopidy folder and use the install script. NB There is no need to ‘sudo’ the commands this time as you are working in your own home directory.
sudo systemctl stop mopidy
..
workon mopidy
pwd
/home/pi/mopidy_dev
git clone https://github.com/mopidy/mopidy.git
...
cd ~/mopidy-dev/mopidy/
pwd
/home/pi/mopidy_dev/mopidy
...
git branch
* develop
pip install --upgrade --editable .
Next we’ll want to run Mopidy from the Git repo. There’s two reasons for this: first of all, it lets you easily change the source code, restart Mopidy, and see the change take effect. Second, it’s a convenient way to keep at the bleeding edge, testing the latest developments in Mopidy itself or test some extension against the latest Mopidy changes.
Assuming you’re still inside the Git repo, use pip to install Mopidy from the Git repo in an “editable” form:
pip install --upgrade --editable .
If the above command fails with AttributeError: install_layout
please refer to #2037 . Try using:
export SETUPTOOLS_USE_DISTUTILS=stdlib
pip install --upgrade --editable .
You now have an editable version of mopidy you can tinker with. You may like to test it by starting from the command line with the mopidy
or mopidy--verbose
option to see the full gory detail, or omit to see the shorter information (including which config file it is using).
mopidy
INFO 2022-07-19 16:29:58,577 [1632:MainThread] mopidy.__main__
Starting Mopidy 3.3.0
INFO 2022-07-19 16:30:01,056 [1632:MainThread] mopidy.config
Loading config from builtin defaults
INFO 2022-07-19 16:30:01,147 [1632:MainThread] mopidy.config
Loading config from file:///home/pi/.config/mopidy/mopidy.conf
INFO 2022-07-19 16:30:01,170 [1632:MainThread] mopidy.config
Loading config from command line options
INFO 2022-07-19 16:30:05,417 [1632:MainThread] mopidy.__main__
Enabled extensions: iris, m3u, softwaremixer, http, pidi, file, local, stream
INFO 2022-07-19 16:30:05,421 [1632:MainThread] mopidy.__main__
Disabled extensions: spotify, raspberry-gpio
WARNING 2022-07-19 16:30:05,428 [1632:MainThread] mopidy.__main__
Found spotify configuration errors. The extension has been automatically disabled:
WARNING 2022-07-19 16:30:05,435 [1632:MainThread] mopidy.__main__
spotify/username must be set.
WARNING 2022-07-19 16:30:05,440 [1632:MainThread] mopidy.__main__
spotify/password must be set.
WARNING 2022-07-19 16:30:05,445 [1632:MainThread] mopidy.__main__
spotify/client_id must be set.
WARNING 2022-07-19 16:30:05,451 [1632:MainThread] mopidy.__main__
spotify/client_secret must be set.
WARNING 2022-07-19 16:30:05,458 [1632:MainThread] mopidy.__main__
Please fix the extension configuration errors or disable the extensions to silence these messages.
INFO 2022-07-19 16:30:07,010 [1632:MainThread] mopidy.commands
Starting Mopidy mixer: SoftwareMixer
INFO 2022-07-19 16:30:07,037 [1632:MainThread] mopidy.commands
Starting Mopidy audio
INFO 2022-07-19 16:30:07,076 [1632:MainThread] mopidy.commands
Starting Mopidy backends: LocalBackend, FileBackend, M3UBackend, StreamBackend
INFO 2022-07-19 16:30:07,225 [1632:Audio-2] mopidy.audio.actor
Audio output set to "autoaudiosink"
INFO 2022-07-19 16:30:07,565 [1632:MainThread] mopidy.commands
Starting Mopidy core
INFO 2022-07-19 16:30:07,715 [1632:MainThread] mopidy.commands
Starting Mopidy frontends: PiDiFrontend, IrisFrontend, HttpFrontend
INFO 2022-07-19 16:30:07,743 [1632:IrisFrontend-9] mopidy_iris.core
Starting Iris 3.64.0
INFO 2022-07-19 16:30:07,787 [1632:HttpFrontend-11] mopidy.http.actor
HTTP server running at [::ffff:127.0.0.1]:6680
INFO 2022-07-19 16:30:07,791 [1632:MainThread] mopidy.commands
Starting GLib mainloop
You will need to use Ctrl+C to stop it running.