Bug #2770
closedosmo-python-tests fails with both python-2.7 and 3.6 ?!?
100%
Description
when using python-2.7.14:
$ python ./setup.py install ... byte-compiling build/bdist.linux-x86_64/egg/osmopy/__init__.py to __init__.pyc byte-compiling build/bdist.linux-x86_64/egg/osmopy/osmo_interact_common.py to osmo_interact_common.pyc File "build/bdist.linux-x86_64/egg/osmopy/osmo_interact_common.py", line 113 print('Error while verifying transcript file %r' % transcript_file, file=sys.stderr) ^ SyntaxError: invalid syntax
and when using 3.6.4rc1:
$ python3 ./setup.py install Processing osmopython-0.0.3-py3.6.egg removing '/usr/local/lib/python3.6/dist-packages/osmopython-0.0.3-py3.6.egg' (and everything under it) creating /usr/local/lib/python3.6/dist-packages/osmopython-0.0.3-py3.6.egg Extracting osmopython-0.0.3-py3.6.egg to /usr/local/lib/python3.6/dist-packages File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.3-py3.6.egg/osmopy/obscvty.py", line 34 print '\n> %s' % what ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int '\n> %s' % what)? File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.3-py3.6.egg/osmopy/osmo_ctrl.py", line 33 print "Connecting to host %s:%i" % (host, port) ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.3-py3.6.egg/osmopy/osmodumpdoc.py", line 24 print 'generated %r' % filename ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int 'generated %r' % filename)? File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.3-py3.6.egg/osmopy/osmotestconfig.py", line 55 print "Verifying %s, test %s" % (' '.join(cmd), run_test.__name__) ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.3-py3.6.egg/osmopy/osmotestvty.py", line 39 print "Launch: %s from %s" % (' '.join(osmo_vty_cmd), os.getcwd()) ^ SyntaxError: invalid syntax File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.3-py3.6.egg/osmopy/osmoutil.py", line 33 print "Opening /dev/null" ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print "Opening /dev/null")?
This is horribly broken, and I seriously wonder who has made it end up in this state. It's not acceptable, and basically osmo-python-tests is unusable as a result, AFAICT?
Related issues
Updated by msuraev over 6 years ago
- Status changed from New to In Progress
- Assignee changed from 4368 to msuraev
- % Done changed from 0 to 30
The patch series ending with gerrit 5280 would fix it. The problem is that all the patches but last one should have failed jenkins tests. According to the logs there're errors during installation (like the one described in this ticket) but the test still succeed. This means that even after merging the fix it could be broken again without us noticing it.
I'm looking into that ATM.
Updated by msuraev over 6 years ago
- % Done changed from 30 to 50
Gerrit 5481 adds explicit syntax check for both python 2 and 3. It fails if applied on top of current master but works when applied on top of gerrit 5280.
Updated by msuraev over 6 years ago
- Related to Feature #2550: example on how to periodically dump KPI/counter to CSV file added
Updated by msuraev over 6 years ago
- Related to deleted (Feature #2550: example on how to periodically dump KPI/counter to CSV file)
Updated by msuraev over 6 years ago
- Blocks Feature #2550: example on how to periodically dump KPI/counter to CSV file added
Updated by msuraev over 6 years ago
- Status changed from In Progress to Resolved
- % Done changed from 50 to 100
The basic tests are mergedwhichshould prevent this from reappearing. We still should expand it to cover the scripts as well but that's tracked in #2684.
Updated by neels over 6 years ago
The errors setup.py reports are due to the py2 files being installed by py3 and py3 files being installed by py2. So both py2 and py3 install both versions of the scripts and report errors on the respective other ones. I haven't found time to look up how it should be done properly yet, but have recently fixed at least that the executable scripts don't get installed from the wrong versions (which destroyed the shebang) https://gerrit.osmocom.org/4312
Mabe Max's patches address the cross-installation? Haven't looked...
Updated by neels over 6 years ago
neels wrote:
The errors setup.py reports are due to the py2 files being installed by py3 and py3 files being installed by py2.
And to clarify, only because setup.py barfs some errors, it still installs them properly and osmo-python-tests are still usable.
Updated by laforge over 6 years ago
Hi Neels,
On Mon, Dec 18, 2017 at 03:21:44PM +0000, neels [REDMINE] wrote:
And to clarify, only because setup.py barfs some errors, it still installs them properly and osmo-python-tests are still usable.
at least in my case with osmo-python-tests master until this morning this was not the case. I could not get the external tests of OsmoBSC to run despite installing both for python2 and python3.
I'll re-test with current master now (after Max' patches) and will provide feedback.
Updated by laforge over 6 years ago
- Related to Bug #2771: osmo-python-tests: No script named 'osmotestvty.py' added