Bug 53345 - Migrate univention-ipcalc to Python 3
Migrate univention-ipcalc to Python 3
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: General
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-0-errata
Assigned To: Philipp Hahn
Florian Best
: python3-migration
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-05-27 16:11 CEST by Florian Best
Modified: 2021-09-29 17:10 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2021-05-27 16:11:39 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
Comment 1 Philipp Hahn univentionstaff 2021-05-28 08:15:00 CEST
Please take Bug #22511 into account before doing the conversion!
Comment 4 Philipp Hahn univentionstaff 2021-09-26 13:47:41 CEST
[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(-)
Comment 5 Philipp Hahn univentionstaff 2021-09-27 08:20:42 CEST
[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(-)
Comment 6 Florian Best univentionstaff 2021-09-27 10:53:42 CEST
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
Comment 7 Philipp Hahn univentionstaff 2021-09-27 12:52:26 CEST
(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(-)