weso / CWR-DataApi

CWR-DataApi
MIT License
34 stars 29 forks source link

Can't be installed as a dependency on python 2.6 #91

Closed Bernardo-MG closed 9 years ago

Bernardo-MG commented 9 years ago

It seems to be a problem with the setuptools. Python 2.6 is unable to install it, ast gives an error.

Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-pvoocy/CWR-API/setup.py", line 29, in <module>
        f.read().decode('utf-8')).group(1)))
      File "/opt/python/2.6.9/lib/python2.6/ast.py", line 49, in literal_eval
        node_or_string = parse(node_or_string, mode='eval')
      File "/opt/python/2.6.9/lib/python2.6/ast.py", line 37, in parse
        return compile(expr, filename, mode, PyCF_ONLY_AST

Check https://github.com/rubik/radon/issues/21

Bernardo-MG commented 9 years ago

Fixed by stripping the version number from non-characters.

with open('webapp/__init__.py', 'rb', encoding='utf-8') as f:
    version = f.read()
    version = _version_re.search(version).group(1)
    version = str(ast.literal_eval(version.rstrip()))