#!/usr/bin/env python
# -*- coding: utf-8 -*-

import re
from setuptools import setup, find_packages
import sys

#Only 2.6-2.7 are supported.
if not ((2, 6, 0) <= sys.version_info[:3] <= (2, 7, 5)):
    sys.stderr.write('gmusicapi does not officially support this Python version.\n')
    #try to continue anyway

dynamic_requires = []

if sys.version_info[:2] == (2, 6):
    dynamic_requires += ['unittest2 == 0.5.1', 'simplejson == 3.0.7']


#This hack is from http://stackoverflow.com/a/7071358/1231454;
# the version is kept in a seperate file and gets parsed - this
# way, setup.py doesn't have to import the package.

VERSIONFILE = 'gmusicapi/_version.py'

version_line = open(VERSIONFILE).read()
version_re = r"^__version__ = ['\"]([^'\"]*)['\"]"
match = re.search(version_re, version_line, re.M)
if match:
    version = match.group(1)
else:
    raise RuntimeError("Could not find version in '%s'" % VERSIONFILE)

setup(
    name='gmusicapi',
    version=version,
    author='Simon Weber',
    author_email='simon@simonmweber.com',
    url='http://pypi.python.org/pypi/gmusicapi/',
    packages=find_packages(),
    scripts=[],
    license=open('LICENSE').read(),
    description='An unofficial api for Google Play Music.',
    long_description=(open('README.rst').read() + '\n\n' +
                      open('HISTORY.rst').read()),
    install_requires=[
        'validictory == 0.9.1',    # validation
        'decorator == 3.4.0',      # keep
        'mutagen == 1.22',         # MM
        'protobuf == 2.5.0',       # MM
        'requests == 2.0.1',       # keep
        'python-dateutil == 2.1',  # MM
        'proboscis==1.2.5.3',      # testing
        'oauth2client==1.2',       # MM
        'mock==1.0.1',             # testing
        'appdirs==1.2.0',          # keep
    ] + dynamic_requires,
    classifiers=[
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Topic :: Multimedia :: Sound/Audio',
        'Topic :: Software Development :: Libraries :: Python Modules'
    ],
    include_package_data=True,
    zip_safe=False,
)

@@ -1381,16 +1381,26 @@
 ory 
-=
+%3E= 0.8.3, %3C
 = 0.9.
-1
+3
 ',  
@@ -1433,17 +1433,28 @@
 corator 
-=
+%3E= 3.3.2,  %3C
 = 3.4.0'
@@ -1450,25 +1450,24 @@
   %3C= 3.4.0',
- 
      # keep%0A
@@ -1487,17 +1487,26 @@
 gen 
-=
+%3E= 1.20, %3C
 = 1.22',
     
@@ -1501,16 +1501,17 @@
 = 1.22',
+ 
         
@@ -1534,17 +1534,27 @@
 rotobuf 
-=
+%3E= 2.4.1, %3C
 = 2.5.0'
@@ -1584,17 +1584,27 @@
 equests 
-=
+%3E= 1.0.4, %3C
 = 2.0.1'
@@ -1651,16 +1651,26 @@
 == 2.1',
+          
   # MM%0A 
@@ -1690,23 +1690,33 @@
 scis
-==
+ %3E= 
 1.2.5.3
-'
 , 
-   
+%3C= 1.2.6.0',
   # 
@@ -1744,18 +1744,28 @@
 h2client
-==
+ %3E= 1.1, %3C= 
 1.2',   
@@ -1790,19 +1790,29 @@
 mock
-==
+ %3E= 1.0.0, %3C= 
 1.0.1',
-  
     
@@ -1848,17 +1848,27 @@
 dirs
+ 
 ==
+ 
 1.2.0',
+        
     

add ranges for dependencies