agoragames / kairos

Python module for time series data in Redis and Mongo
BSD 3-Clause "New" or "Revised" License
207 stars 38 forks source link

Syntax error on Centos 6.2, python 2.6.6 #24

Closed machinethinking closed 11 years ago

machinethinking commented 11 years ago

root@netops-disparity-master-1:~# easy_install kairos Searching for kairos Reading http://pypi.python.org/simple/kairos/ Best match: kairos 0.5.0 Downloading https://pypi.python.org/packages/source/k/kairos/kairos-0.5.0.tar.gz#md5=061fc841868b049c07c0f08cb41f3f32 Processing kairos-0.5.0.tar.gz Running kairos-0.5.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-4723C5/kairos-0.5.0/egg-dist-tmp-1tisd warning: no files found matching '' under directory 'script/' no previously-included directories found matching '_.pyc' SyntaxError: ('invalid syntax', ('build/bdist.linux-x86_64/egg/kairos/timeseries.py', 529, 46, ' return { t : self._transform(data,t) for t in transform }\n'))

Not that it probably matters for this, but ordereddict is installed

root@netops-disparity-master-1:~# python Python 2.6.6 (r266:84292, Dec 7 2011, 20:48:22) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import ordereddict

machinethinking commented 11 years ago

I forked and made some edits that I believe resolved the immediate issue. I'd send a pull request but due to no mongo I wasn't able to fully run the tests, plus i found some other issues, though those turned up on a ubuntu machine running python 2.7 as well. Also my lint checker cleaned up a bunch of extraneous whitespace and made for a much larger commit. Look in my repos if you want to see. Here's the diff

529 - return { t : self._transform(data,t) for t in transform } 529 + return dict((t, self._transform(data, t)) for t in transform) 530 530 elif isinstance(transform, dict): 531 - return { tn : self._transform(data,tf) for tn,tf in transform.iteritems() } 531 + return dict((tn, self._transform(data, t)) for tn,tf in transform.iteritems())

Trying out the given examples, I ran into problems like this after the above edit and trying on a python 2.7 machine

wfrancis@desktop:~/tmp/kairos-master/script# python example Traceback (most recent call last): File "example", line 25, in 'count_only': COUNT_ONLY TypeError: new() takes exactly 2 arguments (3 given)

awestendorf commented 11 years ago

It appears that kairos isn't compatible with 2.6. I don't know as I plan to ensure that it is, as I also want it to be python-3 compatible (though it isn't 100% currently), and 2.7 is a better target with that in mind.