Commit Graph

8 Commits

Author SHA1 Message Date
Oliver Smith 75ad67f1bb debian: set compat level to 10
Related: OS#5958
Change-Id: Ib45ad7c44cdefa4c5acab2da09f24796253a133d
2023-04-25 16:48:32 +02:00
Harald Welte 22e3186410 update git URLs (git -> https; gitea)
Change-Id: I9adbf43ae589461c34814157ff41e403dc54091c
2022-06-18 12:31:58 +02:00
Oliver Smith 934caf1a81 Drop python2 support (again)
Re-apply reverted commit Iabda95073faa2191fd117e9637e0858c589e9d9e
("Drop python2 support"), but with additional changes to make the
scripts actually work with python3 and to make it build without python2.

I have verified, that the contrib/jenkins.sh scripts of all Osmocom
repositories (with their python3 patches on top) are working with this
patch and that all Osmocom repositories with the python3 patches build
in OBS (tested in own namespace).

All related patches for changing from python2 to 3 in other repositories
must be merged shortly after this one, as soon as the build slaves were
(automatically) updated to have the new osmo-python-tests installed:
https://gerrit.osmocom.org/q/topic:drop-py2

New fixes:
* osmopy/obscvty.py: verify: fix compare
  Comparing maps in python3 does not work the same as in python2. Convert
  them to lists first, so the compare works as intended again.
  Fix error:
	  File "/home/user/code/osmo-dev/src/osmo-python-tests/scripts/osmotestvty.py", line 57, in test_history
	    assert(self.vty.w_verify(test_str, [t1]))
	AssertionError
* osmopy/obscvty.py: use enc/dec with send/recv
  Fix error:
		self.socket.send("%s\r" % request)
	TypeError: a bytes-like object is required, not 'str'
* scripts/osmotestconfig.py: use encode() before writing to file
  Fix error:
	File "/home/user/code/osmo-dev/src/osmo-python-tests/scripts/osmotestconfig.py", line 91, in copy_config
		tmpfile.write(open(config).read())
	File "/usr/lib/python3.5/tempfile.py", line 622, in func_wrapper
		return func(*args, **kwargs)
	TypeError: a bytes-like object is required, not 'str'
* debian/control: add --buildsystem=pybuild. Otherwise "--with python3"
  is ignored and the build fails if python2 is not installed, with:
  	Can't exec "pyversions": No such file or directory at /usr/[...]/python_distutils.pm line 120.

Related: OS#2819
Change-Id: I3ffc3519bf6c22536a49dad7a966188ddad351a7
2019-12-11 12:28:40 +01:00
Oliver Smith b0ba927e33 Revert "Drop python2 support"
This reverts commit fb1dc7c405.

I was under the impression, that all previous scripts were already
working with python 3. But as it turns out, this isn't true. Reverting,
so I can properly post follow-up patches, that fix the issues before we
apply this "drop python2" patch again.

Related: OS#2819
Change-Id: Ic1559d1a9f7839fa86a841d62a04b22e1caed466
2019-12-06 16:06:38 +01:00
Oliver Smith fb1dc7c405 Drop python2 support
Remove all compatibility code for python2.

All scripts are already python 3 compatible since
I80e5850a8978d78cda793e2192ef4bd3fd54a121 and
I1b4a629f12863c498a8681b555f57b4e255cebfb.

dpkg-buildpackage shows that it is still invoking setup.py with python
in addition to python3, on debian stretch. But after spending quite some
time on trying to convince it to not care about python2 without success
(trying different variables, overrides, --without python2 flags etc.),
I'm leaving it as is. The resulting package is the python3 package, which
is what we want.

Related: OS#2819
Change-Id: Iabda95073faa2191fd117e9637e0858c589e9d9e
2019-12-05 13:41:38 +01:00
Daniel Willmann a7eda7f113 osmo-trap2cgi: Fix script installation and dependencies
* Install systemd file with debian
* Depend on python3-aiohttp in python3-osmopy-utils as it is required
  for osmo-trap2cgi

Related: SYS#4399
Sponsored-by: On-Waves ehf
Change-Id: I6add5f37b63dd5fcfdefe0459b539e0050d03897
2019-02-04 15:45:23 +01:00
Pau Espin f1f8285b79 debian: Add python module deps for python3-osmopy-utils
Change-Id: I97adcb156205389a75d13a53ecab5638c4672436
2018-07-12 11:12:29 +02:00
Harald Welte 8cd233a826 Add debian packaging rules
This allows us to package osmopy as debian package.

The package currently includes both the library as well as the
executables/scripts.  It might make sense to separate that into
a pure library package and an "utils" package

Related: SYS#3028
Change-Id: I332fb82d0e8dd09c5cf53caafa6a63297a8e3881
2018-06-26 15:58:45 +02:00