Univention Bugzilla – Bug 53345
Migrate univention-ipcalc to Python 3
Last modified: 2021-09-29 17:10:21 CEST
univention-ipcalc should be migrated to be Python 3 compatible. base/univention-ipcalc/univention-ipcalc:#!/usr/bin/python2.7 base/univention-ipcalc/univention-ipcalc6:#!/usr/bin/python2.7 base/univention-ipcalc/univention/ipcalc.py:#!/usr/bin/python2.7
Please take Bug #22511 into account before doing the conversion!
https://git.knut.univention.de/univention/ucs/-/merge_requests/129
[5.0-0] 9c6eae9980 doc[ipcalc] Add PEP-484 type annotations base/univention-ipcalc/debian/control | 2 ++ base/univention-ipcalc/univention/ipcalc/__init__.py | 13 ++++++++++++- base/univention-ipcalc/univention/ipcalc/__main__.py | 5 ++++- 3 files changed, 18 insertions(+), 2 deletions(-) [5.0-0] e4bffa7fa0 style[ipcalc] Convert to ArgumentParser base/univention-ipcalc/univention/ipcalc/__init__.py | 1 - base/univention-ipcalc/univention/ipcalc/__main__.py | 71 ++++++++++++++++++++-------------------- 2 files changed, 35 insertions(+), 37 deletions(-) [5.0-0] bcd07cef0f style[ipcalc] Use sys.exit() to print error base/univention-ipcalc/univention/ipcalc/__main__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) [5.0-0] c9d5bc8129 style[ipcalc] Move docstring base/univention-ipcalc/univention/ipcalc/__init__.py | 5 ++--- base/univention-ipcalc/univention/ipcalc/__main__.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) [5.0-0] c0fb55760b test[ipcalc] Convert to pytest base/univention-ipcalc/.gitignore | 5 +++ base/univention-ipcalc/debian/control | 4 ++ base/univention-ipcalc/debian/ucslint.overrides | 4 +- base/univention-ipcalc/setup.cfg | 38 +++++++++++++++++++ base/univention-ipcalc/tests/test-all.sh | 25 ------------ base/univention-ipcalc/tests/test-univention-ipcalc.sh | 29 -------------- base/univention-ipcalc/tests/test_ipcalc.py | 45 ++++++++++++++++++++++ base/univention-ipcalc/tests/test_main.py | 59 +++++++++++++++++++++++++++++ .../univention/{ipcalc.py => ipcalc/__init__.py} | 11 ------ .../{univention-ipcalc6 => univention/ipcalc/__main__.py} | 0 10 files changed, 153 insertions(+), 67 deletions(-) [5.0-0] 48178f65fd style[ipcalc] Convert to setuptool base/univention-ipcalc/debian/control | 2 ++ base/univention-ipcalc/debian/python-univention-ipcalc.install | 1 - .../univention-ipcalc/debian/python-univention-ipcalc.pyinstall | 1 + base/univention-ipcalc/debian/python3-univention-ipcalc.install | 1 - .../debian/python3-univention-ipcalc.pyinstall | 1 + base/univention-ipcalc/debian/rules | 10 ++------ base/univention-ipcalc/debian/ucslint.overrides | 1 + base/univention-ipcalc/debian/univention-ipcalc.install | 2 +- base/univention-ipcalc/setup.cfg | 39 +++++++++++++++++++++++++++++ base/univention-ipcalc/setup.py | 11 ++++++++ Package: univention-system-setup Version: 13.0.3-35A~5.0.0.202109261332 Branch: ucs_5.0-0 Scope: errata5.0-0 Package: univention-ipcalc Version: 11.0.0-2A~5.0.0.202109261339 Branch: ucs_5.0-0 Scope: errata5.0-0 [5.0-0] bd2ddb22f0 Bug #22511: univention-ipcalc 11.0.0-2A~5.0.0.202109261339 doc/errata/staging/{univention-ipcalc.yml => univention-ipcalc.yaml} | 2 +- doc/errata/staging/univention-system-setup.yaml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
[5.0-0] 4df640db5d fix[ipcalce] Re-add .egg-info base/univention-ipcalc/debian/changelog | 6 ++++++ base/univention-ipcalc/debian/control | 1 + base/univention-ipcalc/debian/python-univention-ipcalc.pyinstall | 1 + base/univention-ipcalc/debian/python3-univention-ipcalc.pyinstall | 1 + base/univention-ipcalc/debian/rules | 2 ++ 5 files changed, 11 insertions(+) [5.0-0] d95644fb21 fix[ipcalc] Entry point name base/univention-ipcalc/.gitignore | 2 ++ base/univention-ipcalc/debian/changelog | 6 ++++++ base/univention-ipcalc/setup.cfg | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) Package: univention-ipcalc Version: 11.0.0-4A~5.0.0.202109270818 Branch: ucs_5.0-0 Scope: errata5.0-0 [5.0-0] 026b44ec21 Bug #22511: univention-ipcalc 11.0.0-4A~5.0.0.202109270818 doc/errata/staging/univention-ipcalc.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
FYI: The python 2 variant has no __main__. OK, because no script calls it and we will drop py2.7 support soon. FYI: setup.cfg contains "name = Univention IP calculation" instead of "name=univention.ipcalc" leading to: /usr/lib/python2.7/dist-packages/Univention_IP_calculation.egg-info /usr/lib/python2.7/dist-packages/Univention_IP_calculation.egg-info/PKG-INFO /usr/lib/python2.7/dist-packages/Univention_IP_calculation.egg-info/dependency_links.txt /usr/lib/python2.7/dist-packages/Univention_IP_calculation.egg-info/entry_points.txt /usr/lib/python2.7/dist-packages/Univention_IP_calculation.egg-info/not-zip-safe /usr/lib/python2.7/dist-packages/Univention_IP_calculation.egg-info/requires.txt /usr/lib/python2.7/dist-packages/Univention_IP_calculation.egg-info/top_level.txt /usr/lib/python3/dist-packages/Univention_IP_calculation.egg-info /usr/lib/python3/dist-packages/Univention_IP_calculation.egg-info/PKG-INFO /usr/lib/python3/dist-packages/Univention_IP_calculation.egg-info/dependency_links.txt /usr/lib/python3/dist-packages/Univention_IP_calculation.egg-info/entry_points.txt /usr/lib/python3/dist-packages/Univention_IP_calculation.egg-info/not-zip-safe /usr/lib/python3/dist-packages/Univention_IP_calculation.egg-info/requires.txt /usr/lib/python3/dist-packages/Univention_IP_calculation.egg-info/top_level.txt If you want to change this, feel free. OK: Python 3 migration OK: YAML
(In reply to Florian Best from comment #6) > FYI: The python 2 variant has no __main__. OK, because no script calls it > and we will drop py2.7 support soon. I is not included because `/usr/bin/univention-ipcalc` should use python3 > FYI: setup.cfg contains "name = Univention IP calculation" instead of > "name=univention.ipcalc" leading to: ... > If you want to change this, feel free. Done [5.0-0] 5c6800f550 style[ipcalc] Rename python package base/univention-ipcalc/.gitignore | 2 ++ base/univention-ipcalc/debian/changelog | 6 ++++++ base/univention-ipcalc/debian/clean | 9 +++++++++ base/univention-ipcalc/debian/python-univention-ipcalc.pyinstall | 2 +- base/univention-ipcalc/setup.cfg | 2 +- 5 files changed, 19 insertions(+), 2 deletions(-) Package: univention-ipcalc Version: 11.0.0-5A~5.0.0.202109271248 Branch: ucs_5.0-0 Scope: errata5.0-0 [5.0-0] eeb71ed91e Bug #22511: univention-ipcalc 11.0.0-5A~5.0.0.202109271248 doc/errata/staging/univention-ipcalc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
<https://errata.software-univention.de/#/?erratum=5.0x107> <https://errata.software-univention.de/#/?erratum=5.0x108>