simon-weber / gmusicapi

An unofficial client library for Google Music.
https://unofficial-google-music-api.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2.48k stars 257 forks source link

Remove upper bound on dependency requirements #207

Closed jodal closed 10 years ago

jodal commented 10 years ago

I appreciate that you've recently loosened the dependency version requirements (ref #198), but the requirements are still way too tight.

My specific use case is Mopidy with its growing ecosystem of extensions, all necessarily needing to live in the same env/virtualenv as Mopidy itself. Since Mopidy-GMusic use gmusicapi, which again lock e.g. requests to <= 2.1.0, no other package in the entire ecosystem can use a newer version without creating havoc.

User scenario: If a user installed another Mopidy extension requiring "requests >= 2" first, he naturally got the latest version, 2.2.0. If he then installs Mopidy-GMusic, gmusicapi is dragged in as well. When he then tries to start Mopidy everything fails because gmusicapi requires an older version than what's installed, and Mopidy, trying to be nice and user friendly, checks that all dependencies are in place when loading extensions.

Generally, I'd use the following guidelines when setting requirements for a library (which is a very different use case from a application where you want to pin exact versions of everything):

  1. Start with a dependency with no version requirement.
  2. If you know you need a feature/bugfix that is only present from a specific version, add a lower version bound.
  3. In the odd case you know that there are changes in the new version that will not work with your library, add an temporary upper boundary. As soon as you update your library to work with the newer dependency, you remove the upper boundary.
simon-weber commented 10 years ago

Many apologies for the pain this caused your users! I should have a chance to fix this either tonight or tomorrow.

jodal commented 10 years ago

That would be great! Can you make sure to push a release as well?

simon-weber commented 10 years ago

Definitely; I'll be sure to update this issue.

ps, congrats on Mopidy's recent inclusion into the Ubuntu and Debian repos!

jodal commented 10 years ago

Thanks :-)

simon-weber commented 10 years ago

@jodal how does this look? https://github.com/simon-weber/Unofficial-Google-Music-API/compare/918f63ff94fd8ecfd3a63dcc07312d104b9645e6...loosen-dep-ranges

jodal commented 10 years ago

I'd maybe set < 2 on python-dateutil. I'm interpreting ! 2.0 as "not 2.0, but 2.1 is okay". Not sure exactly how it is interpreted by the tools.

Other than that, it looks great :-)

simon-weber commented 10 years ago

Yeah, that's actually what I'm going for -- I was pleasantly surprised that it was interpreted correctly, haha. Dateutil is weird in that 2.0 is 3-only, but 2.1 works with 2 and 3: http://bazaar.launchpad.net/~dateutil/dateutil/trunk/view/head:/NEWS.

I'll go ahead and release this. Thanks again for bringing it up!

simon-weber commented 10 years ago

3.1.0 is out!