Bug 49136 - Migrate base/univention-lib to dh_python2
Migrate base/univention-lib to dh_python2
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: General
UCS 4.4
All Linux
: P5 normal (vote)
: UCS 4.4-0-errata
Assigned To: Florian Best
Jürn Brodersen
:
Depends on: 49140 49174
Blocks: 28497 49129 49138 49176
  Show dependency treegraph
 
Reported: 2019-03-28 10:25 CET by Florian Best
Modified: 2019-11-05 17:12 CET (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 2019-03-28 10:25:49 CET
The package base/univention-lib should be migrated to use dh_python instead of python-support.

Migration-Guide: https://hutten.knut.univention.de/mediawiki/index.php/Python_DebHelper_Migration
Comment 1 Florian Best univentionstaff 2019-04-04 15:21:01 CEST
Depends on:
services/univention-printserver/cups-printers.py:»   »   »   subprocess.call(['python', '/usr/share/pyshared/univention/lib/share_restrictions.py'])
Comment 2 Florian Best univentionstaff 2019-04-04 15:27:25 CEST
Pyshared references needs to be adjusted:
base/univention-lib/shell/license.sh:»   python /usr/share/pyshared/univention/lib/license_tools.py
Comment 3 Florian Best univentionstaff 2019-04-18 14:00:49 CEST
Package has been migrated. Hardcoded uses of pyshared/pymodules has been replaced with python -m.
Except for the utility functions in base.sh because they need to be done when migrating UCR.

f735fd1cb547 | Bug #49136: adjust python script path

univention-lib (8.0.0-6)
d3b84ff14719 | Bug #49136: Merge branch 'dh-python/49136-univention-lib' into 4.4-0
e2aeaeb31cb7 | Bug #49136: pep8
4d2144c3e059 | Bug #49136: migrate calls to ucs_registerLDAPExtension / ucs_unregisterLDAPExtension
85e7232b43b2 | Bug #49136: migrate to dh_python
9d0ba8760cd9 | Bug #49136: migrate to dh_python
d667a3d8e0db | Bug #49136: fix use of pyshared path

univention-lib.yaml
d3b84ff14719 | Bug #49136: Merge branch 'dh-python/49136-univention-lib' into 4.4-0
d11943977f38 | YAML Bug #49136
Comment 4 Florian Best univentionstaff 2019-04-18 15:52:26 CEST
I created the package python3-univention-lib and made it importable/installable:
apt-get download python3-univention-lib
dpkg -i --ignore-depends=python3-{ldap,ldb,samba,univention-{debug,config-registry}} python3-univention-lib_*.deb

univention-lib (8.0.0-7)
43956305b3dd | Bug #49136: fix exception reraising
8eeaeb7d6856 | Bug #49136: libfuturize.fixes.fix_print_with_import
c96a6bee28e5 | Bug #49136: Add python3-univention-lib package
Comment 5 Florian Best univentionstaff 2019-05-10 15:00:02 CEST
I adjusted the dependencies for the python3 package: Depend: python3-ldap | python3-pyldap. Thanks!
Comment 6 Philipp Hahn univentionstaff 2019-05-28 14:24:40 CEST
[4.4-0] 335a4acd2f Bug #49176 lib: Fix pysupport during update
 base/univention-lib/debian/changelog                      | 6 ++++++
 base/univention-lib/debian/python-univention-lib.install  | 1 +
 base/univention-lib/debian/python-univention-lib.postinst | 4 ++++
 base/univention-lib/python-univention-lib.public          | 1 +
 base/univention-lib/python/__init__.py                    | 5 ++---
 5 files changed, 14 insertions(+), 3 deletions(-)

Package: univention-lib
Version: 8.0.1-20A~4.4.0.201905281421
Branch: ucs_4.4-0
Scope: errata4.4-0

[4.4-0] d80cebf799 Bug #49136: univention-lib 8.0.1-20A~4.4.0.201905281421
 doc/errata/staging/univention-lib.yaml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

QA:
  __import__("univention.lib").lib.__path__
  # ['/usr/lib/python2.7/dist-packages/univention/lib','/usr/lib/pymodules/python2.7/univention/lib']
  __import__("univention.lib.account").lib.account.__file__
  # '/usr/lib/pymodules/python2.7/univention/lib/account.pyc'
  __import__("univention.lib.ucs").lib.ucs.__file__
  # '/usr/lib/python2.7/dist-packages/univention/lib/ucs.pyc'

  update-python-modules -f
Comment 7 Jürn Brodersen univentionstaff 2019-05-28 17:17:09 CEST
What I tested:
The test was always the same:
'''
from univention.lib import password  # installed through pysupport
from univention.lib import error  # installed through dh_python
'''
and in a new process the other way around

Update from errata0 -> OK
Update from errata113 (includes updated univention-python) -> OK
Installing latest test iso -> OK

update-python-modules -f -> OK (__init__.py is not overwritten with an empty file and imports work)
No jenkins test failures seem to be related to this -> OK
YAML -> OK