Hi Max,
in osmo-python-tests master, I did
python2 setup.py install rm -rf build/ dist/ osmopython.egg-info python3 setup.py install
which results in osmotestvty.py installed as py3, causing an encoding problem which I mentioned; py3 is a lot more than print() with braces, see the error log below.
So in principle I still don't understand why the py2 scripts need to be made py3 compatible, and why I need to add 'from future' imports to py3 scripts now. There has to be a better way.
About the need to rm the installation artifacts, there is no mention of it in the README. And even when I remove those, I still get py2 scripts installed as py3.
So anyone is bound to get this error:
" osmotestvty.py -p /n/s/osmo-dev/make/osmo-msc/../../src/osmo-msc -w /n/s/osmo-dev/make/osmo-msc -v confpath /n/s/osmo-dev/make/osmo-msc/../../src/osmo-msc, workdir /n/s/osmo-dev/make/osmo-msc Running tests for specific VTY commands test_history (__main__.TestVTY) ... Launch: ./src/osmo-msc/osmo-msc -c /n/s/osmo-dev/make/osmo-msc/../../src/osmo-msc/doc/examples/osmo-msc/osmo-msc.cfg from /n/s/osmo-dev/make/osmo-msc Opening /dev/null Launching: PWD=/n/s/osmo-dev/make/osmo-msc './src/osmo-msc/osmo-msc' '-c' '/n/s/osmo-dev/make/osmo-msc/../../src/osmo-msc/doc/examples/osmo-msc/osmo-msc.cfg' Terminating took 2.679s ERROR test_terminal_length (__main__.TestVTY) ... Launch: ./src/osmo-msc/osmo-msc -c /n/s/osmo-dev/make/osmo-msc/../../src/osmo-msc/doc/examples/osmo-msc/osmo-msc.cfg from /n/s/osmo-dev/make/osmo-msc Launching: PWD=/n/s/osmo-dev/make/osmo-msc './src/osmo-msc/osmo-msc' '-c' '/n/s/osmo-dev/make/osmo-msc/../../src/osmo-msc/doc/examples/osmo-msc/osmo-msc.cfg' Terminating took 2.679s ERROR test_unknown_command (__main__.TestVTY) ... Launch: ./src/osmo-msc/osmo-msc -c /n/s/osmo-dev/make/osmo-msc/../../src/osmo-msc/doc/examples/osmo-msc/osmo-msc.cfg from /n/s/osmo-dev/make/osmo-msc Launching: PWD=/n/s/osmo-dev/make/osmo-msc './src/osmo-msc/osmo-msc' '-c' '/n/s/osmo-dev/make/osmo-msc/../../src/osmo-msc/doc/examples/osmo-msc/osmo-msc.cfg' Terminating took 2.679s ERROR
====================================================================== ERROR: test_history (__main__.TestVTY) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.6-py3.6.egg/EGG-INFO/scripts/osmotestvty.py", line 56, in test_history File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.6-py3.6.egg/osmopy/obscvty.py", line 223, in command return self._common_command(request, close) File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.6-py3.6.egg/osmopy/obscvty.py", line 179, in _common_command self.socket.send("%s\r" % request) TypeError: a bytes-like object is required, not 'str' "
With your recent set of changes, you have not only hung all the build slaves' osmo-python-tests updates for 3 weeks, but also dismantled the installation. I wonder how it was possible for this to get past your testing.
I will try to get the scripts working for me now.
~N
Sorry for the inconvenience, I'm looking into it - I've made https://osmocom.org/issues/2821 to track this.
On 08.01.2018 11:38, Neels Hofmeyr wrote:
With your recent set of changes, you have not only hung all the build slaves' osmo-python-tests updates for 3 weeks, but also dismantled the installation. I wonder how it was possible for this to get past your testing.
Seem like I had symlink from before which interfered with pip install. I've reproduced it now. I'll see how can we integrate it into jenkins tests in osmo-python-tests.
Hi.
The quick workaround is available in https://gerrit.osmocom.org/#/c/5677/ Just in case make sure to uninstall older version first - I'm not sure if setup.py handles it correctly.
On a related note.
On 08.01.2018 11:38, Neels Hofmeyr wrote:
With your recent set of changes, you have not only hung all the build slaves' osmo-python-tests updates for 3 weeks
This should not be happening - I do not see any notification for failed builds from update-* jobs. I think it's essential to get those right away to avoid such hiccups in future. I'll look into jobs definitions to see if I can fix those.
Interesting, I notice that now the python scripts are no longer installed in a way where you can find or grep them.
In /usr/local/bin, I get "EASY-INSTALL" shims like
#!/usr/bin/python2 # EASY-INSTALL-SCRIPT: 'osmopython==0.0.6','osmotestvty.py' __requires__ = 'osmopython==0.0.6' __import__('pkg_resources').run_script('osmopython==0.0.6', 'osmotestvty.py')
and in /usr/local/lib/py*, all I get is "egg" files which appear to be zip balls of the actual python scripts.
Actual error messages refer to the file inside the zip egg:
File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.6-py3.6.egg/osmopy/obscvty.py", line 179, in _common_command self.socket.send("%s\r" % request) TypeError: a bytes-like object is required, not 'str'
I liked to have the scripts in plain sight, I doubt that zipping some py script has any benefits that outweigh unzipping cost ... but I guess it's bearable when aware of this.
~N