Bug #5694
closedtest_cli uses python 2.7+ constructs
0%
Description
The earlier bugs on this subject, although marked Resolved, did not fix the issue. When I build an rpm under RHEL6/C6, I still get the dreaded
===
python setup.py bdist_rpm
[...]
byte-compiling /root/ceph-deploy/build/bdist.linux-x86_64/rpm/BUILDROOT/ceph-deploy-1.1-1.x86_64/usr/lib/python2.6/site-packages/ceph_deploy/forgetkeys.py to forgetkeys.pyc
writing byte-compilation script '/tmp/tmpFZJ9nq.py'
/usr/bin/python -O /tmp/tmpFZJ9nq.py
SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/ceph_deploy/tests/test_cli.py', 26, 26, ' assert {p.basename for p in tmpdir.listdir()} set()\n'))
=
A possible fix would be to replace the set comphrension with the list comphrension, as the result is just tested against the empty set/list. (C6 uses python 2.6.6, set comprehensions were introduced in python 2.7+)
Also mentioned in one of the earlier bugreports, the intend was to not distribute the tests at all. Attached is a diff which fixes both issues.
Files
Updated by Sage Weil almost 11 years ago
- Assignee set to Alfredo Deza
- Priority changed from Normal to Urgent
Updated by Alfredo Deza almost 11 years ago
- Status changed from New to In Progress
I was not aware we were using Python 2.6
We will add that to our testing harness so we can run tests under 2.6 too and make sure they are passing before we attempt a release.
Leaving tests within a package is very useful though, so I am hesitant to remove tests from the actual package.
Updated by Alfredo Deza almost 11 years ago
- Status changed from In Progress to 15
Awaiting merge: https://github.com/ceph/ceph-deploy/pull/19