Bug 28497

Summary: pycentral → pysupport → dh_python2
Product: UCS Reporter: Philipp Hahn <hahn>
Component: GeneralAssignee: Philipp Hahn <hahn>
Status: CLOSED FIXED QA Contact: Florian Best <best>
Severity: normal    
Priority: P5 CC: best, gohmann, peichert, troeder
Version: UCS 4.2   
Target Milestone: UCS 4.4-4-errata   
Hardware: All   
OS: Linux   
URL: https://hutten.knut.univention.de/mediawiki/index.php/Python_DebHelper_Migration
See Also: https://forge.univention.org/bugzilla/show_bug.cgi?id=42362
https://forge.univention.org/bugzilla/show_bug.cgi?id=43341
https://forge.univention.org/bugzilla/show_bug.cgi?id=35133
https://forge.univention.org/bugzilla/show_bug.cgi?id=43336
https://forge.univention.org/bugzilla/show_bug.cgi?id=49060
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): API change
Max CVSS v3 score:
Bug Depends on: 49128, 49129, 49130, 49131, 49132, 49133, 49134, 49135, 49136, 49137, 49138, 49139, 49140, 49141, 49142, 49143, 49144, 49145, 49146, 49147, 49148, 49149, 49150, 49151, 49152, 49153, 49154, 49155, 49156, 49157, 49158, 49159, 49160, 49161, 49162, 49163, 49164, 49165, 49166, 49167, 49168, 49169, 49170, 49171, 49172, 49173, 49174, 49175, 49176, 49177, 49178, 49179, 49180, 49181, 50332, 50401, 50425, 51373    
Bug Blocks:    

Description Philipp Hahn univentionstaff 2012-09-13 19:18:50 CEST
Wir wir auf die nächste Debian-Version wechseln, müssen die ganzen Python-Pakete angepasst werden.
Dabei sind in debian/control auch die XS-Python-Version anzupassen, was noch von pycentral stammt. Aktuell für dh_python2 ist "X-Python-Version".
dh_pysupport verwendet derzeit debian/pyversions, was dann auch zu ersetzten ist.
Comment 1 Stefan Gohmann univentionstaff 2014-06-17 14:06:29 CEST
pysupport is still available in UCS 4. Are the benefits of dh_python2 enough?
Comment 2 Stefan Gohmann univentionstaff 2014-06-30 07:58:55 CEST
We will use pysupport for the UCS 4 packages. The main problem is that we have to migrate the whole univention namespace at once. I don't think it is the best solution to do it in such a big update.
Comment 3 Philipp Hahn univentionstaff 2017-02-02 11:12:13 CET
(In reply to Stefan Gohmann from comment #2)
> We will use pysupport for the UCS 4 packages. The main problem is that we
> have to migrate the whole univention namespace at once.

No, you don't have to: <https://docs.python.org/2.7/library/pkgutil.html#pkgutil.extend_path> works quiet well.
The main problem by now is that lots of UCS packages hard-code files in /usr/share/pyshared/, which is wrong and will break left and right if we do the transition.

> I don't think it is the best solution to do it in such a big update.

And you propose to do it when instead? This is going to be an API change, so if not for a major release, when else?
We already procrastinated the change with Debian-Wheezy for UCS-4.0, and it gets worse with Debian-Jessie with UCS-4.2
Comment 4 Florian Best univentionstaff 2017-02-18 05:53:05 CET
(In reply to Philipp Hahn from comment #3)
> > I don't think it is the best solution to do it in such a big update.
> 
> And you propose to do it when instead? This is going to be an API change, so
> if not for a major release, when else?
> We already procrastinated the change with Debian-Wheezy for UCS-4.0, and it
> gets worse with Debian-Jessie with UCS-4.2
And this will probably also ease the transition to Python 3, which is available in UCS 4.2 / Debian Jessie. In UCS 5.x the update will probably not break as much  with dh_python than py_support.
Comment 5 Philipp Hahn univentionstaff 2017-11-16 15:13:52 CET
Also happened with python-univention-odoo
Comment 6 Florian Best univentionstaff 2019-03-28 10:27:45 CET
I created bugs for all our UCS packages except:

packaging/ucslint
packaging/univention-directory-manager-module-example
packaging/univention-package-template-python
packaging/univention-ucs-translation-template
test/ucs-test-tools
test/ucs-test
test/ucs-windows-tools
management/python-notifier
Comment 7 Philipp Hahn univentionstaff 2019-05-21 08:45:54 CEST
[4.4-0] 51379bd8d9 Bug #28497 ucslint: Fix migrate to dh-python
 packaging/ucslint/debian/changelog | 6 ++++++
 packaging/ucslint/debian/control   | 1 +
 2 files changed, 7 insertions(+)

Package: ucslint
Version: 8.0.0-12A~4.4.0.201905210840
Branch: ucs_4.4-0
Scope: errata4.4-0
Comment 8 Florian Best univentionstaff 2019-05-21 10:05:37 CEST
univention-package-template (7.0.1-1)
e53d1afdcf82 | Bug #28497: migrate to dh_python2

ucs-windows-tools (6.0.0-1)
6c5907479481 | Bug #28497: migrate ucs-windows-tools to dh_python2

univention-package-template-python (7.0.0-2)
0c8c69460026 | Bug #28497: migrate to dh_python2

ucslint (8.0.0-11)
1b6cd7415477 | Bug #28497: add python3 support for flake8 plugin
0a6412767c40 | Bug #28497: migrate ucslint to dh-python

ucslint.yaml
ebc7ad5254fe | Bug #28497: YAML

univention-management-console-module-udm (1.0.203-1)
r28497 | univention-management-console-module-udm (1.0.203-1) unstable; urgency=low

ucslint (8.0.0-12)
c5fa5942f46f | Bug #28497: remove debug output
51379bd8d9ca | Bug #28497 ucslint: Fix migrate to dh-python

ucs-test-tools (8.0.0-1)
0a77a7f4afd3 | Bug #28497: migrate ucs-test-tools to dh_python2

ucslint (8.0.0-5)
a35d7cc263ff | Bug #28497: check for dh-python instead of python_support

univention-ucs-translation-template (6.0.0-2)
6fe3a76f3e85 | Bug #28497: migrate to dh_python2

ucs-test (9.0.2-58)
a348e4799c67 | Bug #28497: futurize -nw --no-diffs -f libfuturize.fixes.fix_print_with_import univention/testing/
9554348e4480 | Bug #28497: migrate ucs-test to dh-python
Comment 9 Philipp Hahn univentionstaff 2020-03-31 08:51:16 CEST
All packages in UCS have been migrated to dh_python2:

 git grep pycentral -- ':!**/debian/changelog'
 git grep pysupport -- ':!**/debian/changelog'
  Legacy compatibility code to be removed with UCS-5+
 git grep -n pyshared -- ':!**/debian/changelog' ':!**.public'
 OK:
  test/utils/utils.sh
 TODO:
  management/univention-directory-manager-modules/debian/control
 git grep -n python-support ':!**/debian/changelog'
 OK:
  packaging/ucslint
  test/ucs-test/tests/72_udm-extensions/
 TODO: Re-check the following cases
  univention-system-activation
  services/univention-radius/debian/univention-radius.links
  test/utils/utils.sh
  test/ucs-test/debian/rules

[4.4-4] f5db3652f7 Bug #28497: Complete dh_python2 transition
9       7       base/univention-app-appliance/debian/control
0       1       base/univention-app-appliance/debian/dirs
2       1       base/univention-app-appliance/debian/univention-app-appliance.dirs
0       2       doc/developer-reference/packaging/packaging.xml
9       15      doc/developer-reference/udm/udm.xml
1       1       doc/developer-reference/umc/ucr/debian/control
1       1       management/univention-directory-listener/README.md
0       3       management/univention-directory-manager-modules/debian/python-univention-directory-manager.dirs
0       6       management/univention-ldap/univention-backup2master
0       1       packaging/ucslint/doc/ucslint.1
1       1       packaging/univention-directory-manager-module-example/debian/control
1       1       packaging/univention-directory-manager-module-example/debian/rules
0       2       packaging/univention-directory-manager-module-example/debian/univention-directory-manager-module-example.dirs
1       1       packaging/univention-directory-manager-module-example/debian/univention-directory-manager-module-example.install
1       1       services/univention-admin-diary/scripts/make_udm_events.py
0       4       services/univention-nfs/81univention-nfs-server.inst
0       4       services/univention-radius/debian/copyright
0       3       services/univention-samba/debian/rules
1       1       services/univention-samba4/96univention-samba4.inst
1       1       services/univention-samba4/98univention-samba4-dns.inst
1       1       services/univention-samba4/lib/base.sh
1       1       services/univention-samba4/scripts/setup-dns-in-ucsldap.sh
0       2       services/univention-support-info/debian/control
0       1       services/univention-support-info/debian/univention-support-info.dirs
1       9       services/univention-support-info/univention-support-info
Comment 10 Philipp Hahn univentionstaff 2020-03-31 14:04:25 CEST
[4.4-4] df3fd0c48e Bug #28497: Complete dh_python2 transition fix
 .../debian/python-univention-directory-manager.dirs                    | 3 +++
 1 file changed, 3 insertions(+)
Comment 11 Florian Best univentionstaff 2020-04-17 16:52:14 CEST
OK: git:f5db3652f71d22c53113f006eeb78ac2566fde1b

Took only 7 years to do the migration.
Comment 12 Philipp Hahn univentionstaff 2021-03-19 10:09:22 CET
All changes are released CLOSING