New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash if wrong version of extension dependencies #657

Closed
jodal opened this Issue Jan 21, 2014 · 1 comment

Comments

1 participant
@jodal
Member

jodal commented Jan 21, 2014

We handle missing extension dependencies nicely by simply disabling the extension:

$ mopidy
INFO     Disabled extension soundcloud: Dependency requests>=2.0.0 not found
INFO     Disabled extension beets: Dependency requests>=2.0.0 not found
INFO     Disabled extension gmusic: Dependency requests>=1.1.0 not found
INFO     Enabled extensions: spotify, mpd, stream, scrobbler, mpris, dirble, local
INFO     Disabled extensions: http, beets, nad, gmusic, subsonic, radio-de, arcam, soundcloud
...

Though, if an extension is installed, but has the wrong version, we crash and burn:

$ mopidy 
ERROR    (requests 1.2.3 (/usr/lib/python2.7/dist-packages), Requirement.parse('requests>=2.0.0'))
Traceback (most recent call last):
  File "/home/jodal/dev/mopidy/mopidy/__main__.py", line 78, in main
    if not ext.validate_extension(extension):
  File "/home/jodal/dev/mopidy/mopidy/ext.py", line 219, in validate_extension
    extension.entry_point.require()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2027, in require
    working_set.resolve(self.dist.requires(self.extras),env,installer))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 598, in resolve
    raise VersionConflict(dist,req) # XXX put more info here
VersionConflict: (requests 1.2.3 (/usr/lib/python2.7/dist-packages), Requirement.parse('requests>=2.0.0'))
Traceback (most recent call last):
  File "/home/jodal/dev/virtualenvs/mopidy/bin/mopidy", line 9, in <module>
    load_entry_point('Mopidy==0.18.0', 'console_scripts', 'mopidy')()
  File "/home/jodal/dev/mopidy/mopidy/__main__.py", line 78, in main
    if not ext.validate_extension(extension):
  File "/home/jodal/dev/mopidy/mopidy/ext.py", line 219, in validate_extension
    extension.entry_point.require()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2027, in require
    working_set.resolve(self.dist.requires(self.extras),env,installer))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 598, in resolve
    raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (requests 1.2.3 (/usr/lib/python2.7/dist-packages), Requirement.parse('requests>=2.0.0'))

Having the wrong version should be handled just as nicely as not having the dependency.

@ghost ghost assigned jodal Jan 21, 2014

@jodal jodal closed this in 7ce38de Jan 21, 2014

@jodal

This comment has been minimized.

Member

jodal commented Jan 21, 2014

With the fix, the following happens instead:

$ mopidy
INFO     Disabled extension soundcloud: requests>=2.0.0 required, but found requests 1.2.3 at /usr/lib/python2.7/dist-packages
INFO     Disabled extension beets: requests>=2.0.0 required, but found requests 1.2.3 at /usr/lib/python2.7/dist-packages
INFO     Enabled extensions: spotify, mpd, stream, scrobbler, mpris, dirble, local
INFO     Disabled extensions: http, beets, nad, gmusic, subsonic, radio-de, arcam, soundcloud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment