Bug 49704 - Migrate ucslint to Python3
Migrate ucslint to Python3
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: ucslint
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-4-errata
Assigned To: Philipp Hahn
Florian Best
:
: 46553 (view as bug list)
Depends on:
Blocks: 49060
  Show dependency treegraph
 
Reported: 2019-06-21 13:02 CEST by Philipp Hahn
Modified: 2020-06-24 12:52 CEST (History)
2 users (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:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2019-06-21 13:02:36 CEST
ucslint has no dependencies on UCS specific modules itself, has few other dependencies and is easy to convert to python3.
Comment 2 Philipp Hahn univentionstaff 2020-05-21 14:52:23 CEST
Fixes as part of
commit 201203e4241d94e359d91633881254ecd4182ed7 (HEAD -> 4.4-4)
Merge: b5c78bf91a fa6215000c
Author: Philipp Hahn <hahn@univention.de>
Date:   Wed May 20 17:19:41 2020 +0200

    Bug #49704: Merge branch 'phahn/ucslint' into 4.4-4
    
    Bug #42294      run on svn checkin - don't check generated files for copyright
    Bug #51248      Check debian/compat
    Bug #51247      Minimal debian/*.dirs
    Bug #51246      Check for unassigned debian/$pkg.$dh files
    Bug #51107      Check UCR template for valid Python2/3 syntax
    Bug #51105      Check for invalid Python string escape
    Bug #49704      Migrate ucslint to Python3
    Bug #49683      py3: Check debian/*.ucr files for ConfigParser(strict=true)
    Bug #49620      check for monotonic timestamp in debian/changelog
    Bug #48747      ucslint doesn't warn/error about joinscript-api-bindpwdfile in unjoin scripts
    Bug #43981      Add check for wrong comparision in postinst

[4.4-4] fa6215000c Bug #42294: Invoke ucslint from GitLab-CI
[4.4-4] 7c26cced9e Bug #42294: debian/control ucslint
[4.4-4] f749577efc Bug #42294 ucslint: Run from CI pipeline
[4.4-4] a668865b19 Bug #43981 ucslint: Check Debian maintainer script actions
[4.4-4] 1f5c5b5a09 Bug #49704 ucslint: Convert 0017 to UPCFileTeste
[4.4-4] 1ad5c9bf56 Bug #49704 ucslint: Convert 0002 to UPCFileTeste
[4.4-4] 1f995151c7 Bug #48747 ucslint: Check .uinst files
[4.4-4] b6685dee8a Bug #48747 ucslint: Add filename and line number
[4.4-4] 826f9cc9c3 Bug #49620 USS: Make debian/changelog monotone
[4.4-4] 7853e7e0b7 Bug #49620 ssl: Make debian/changelog monotone
[4.4-4] 7d459daf6f Bug #49620 ucslint: Check debian/changelog is strict-monotonical
[4.4-4] 348d00439e Bug #49683 ucslint: Allow UCRWARNING_ASCII= UCR header
[4.4-4] 296c8949c5 Bug #49688 diary: Remove duplicate UCRV
[4.4-4] 16d7176b52 Bug #49665 samba: Remove duplicate UCRV
[4.4-4] adae84d0be Bug #49689 mail: Remove duplicate UCRV
[4.4-4] 18ba8ddaee Bug #49683 ucslint: Use ConfigParser
[4.4-4] eac6b51cc0 Bug #49683 ucslint: Duplicate check debian/*.ucr
[4.4-4] 5d559b8d0d Bug #49683 ucslint: Incremental syntax check debian/*.ucr
[4.4-4] 75d4831a3c Bug #49683 ucslint: Check debian/*.ucr syntax
[4.4-4] aa72725106 Bug #49683 ucslint: Fix regular expressions
[4.4-4] 6399d11505 Bug #51107 ucslint: Extend testsuite for 0020
[4.4-4] daad950141 Bug #51107 ucslint: flake8 for conffiles
[4.4-4] f5857ea6ab Bug #51246: Rename debian/* files
[4.4-4] 0c005a03f0 Bug #51246 ucslint: Ignore more DH files
[4.4-4] 303365ddc0 Bug #51247: Cleanup debian/*.dirs
[4.4-4] 99406e1ee5 Bug #51247 ucslint: Check debian/*.dirs
[4.4-4] d7df4bcddd Bug #51248: Sync debian/control with debian/compat
[4.4-4] f86daf058d Bug #51248: wrap-and-sort debian/control
[4.4-4] 81aee7ecc9 Bug #51248 ucslint: Check debian/compat
[4.4-4] 00e37d83c7 Bug #51105 ucslint: Check invalid Python string literals
[4.4-4] 3a9554a235 Bug #51105 ucslint: Extract common code
[4.4-4] d96ce205b7 Bug #49704 ucslint: Remove Python 2 code
[4.4-4] b9efd4a3de Bug #49704 ucslint: Use file context manager
[4.4-4] 48ad9457af Bug #49704 ucslint: Fix unicode handling
[4.4-4] 99014c3177 Bug #49704 ucslint: flake8 cleanup
[4.4-4] c159741c4c Bug #49704 ucslint: flake8 --help
[4.4-4] ff50080c19 Bug #49704 ucslint: Refactor 0018
[4.4-4] db86907de8 Bug #49704 ucslint: Convert message info to tuple
[4.4-4] 0e591aa022 Bug #49704 ucslint: Make error reporting independent from display filter
[4.4-4] bd9eeaa8f9 Bug #49704 ucslint: Add JUnit XML support
[4.4-4] a23cc0c887 Bug #49704 ucslint: Add missing mypy/PyDoc
[4.4-4] 71909f14a6 Bug #49704 ucslint: Fix ucspep8 issues
[4.4-4] 4ac398b60d Bug #49704 ucslint: Move to univention namespace
[4.4-4] 8ce7fd7727 Bug #49704 ucslint: Use optparse.append
[4.4-4] bc14dadf88 Bug #49704 ucslint: Improve --help output
[4.4-4] 7ea7202095 Bug #49704 ucslint: Convert to setup.py
[4.4-4] 46abd8b64a Bug #49704 ucslint: Run test suite
[4.4-4] 2deac0ddbd Bug #49704 ucslint: Convert to Python3
[4.4-4] 5c85c35487 Bug #49704 ucslint: Use EnvironmentError
[4.4-4] 7b9f3ba328 Bug #49704 ucslint: Remove default postinit() method
[4.4-4] 7c631f5fe7 Bug #49704 ucslint: Remove dead code
[4.4-4] 89c6b0fe12 Bug #49704 ucslint: Fix shellcheck issues in tests

[4.4-4] 1bde0a6dee Bug #49704 ucslint: Fix running test suite
 packaging/ucslint/debian/control | 1 +
 1 file changed, 1 insertion(+)

[4.4-4] 5f06175d5f Bug #49704 ucslint: Fix running test suite 2
 packaging/ucslint/debian/control | 1 +
 1 file changed, 1 insertion(+)

[4.4-4] db22237608 Bug #49704 ucslint: Fix merged package install
 packaging/ucslint/debian/ucslint.install | 1 -
 1 file changed, 1 deletion(-)

[4.4-4] 2c4ee05348 Bug #51107 ucslint: Fix testsuite for 0020
 packaging/ucslint/testframework/0020.correct           | 2 +-
 packaging/ucslint/testframework/0020/conffiles/python3 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

[4.4-4] 84d8d9c2cc Bug #51107 ucslint: Fix testsuite for 0020 2
 packaging/ucslint/testframework/0020.correct        |  6 +++++-
 packaging/ucslint/testframework/0020/test.py        |  2 +-
 packaging/ucslint/testframework/0020/test2          |  2 +-
 packaging/ucslint/ucslint-sort-output.py            |  2 +-
 packaging/ucslint/univention/ucslint/0020-flake8.py | 10 +++++++---
 5 files changed, 15 insertions(+), 7 deletions(-)


Package: ucslint
Version: 8.0.0-14A~4.4.0.202005210708
Branch: ucs_4.4-0
Scope: errata4.4-4

[4.4-4] 2bf7de9926 Bug #49704: ucslint 8.0.0-14A~4.4.0.202005210708
 doc/errata/staging/ucslint.yaml | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
Comment 3 Florian Best univentionstaff 2020-05-25 11:08:43 CEST
There is an error during package upgrade: Maybe missing some "Breaks" entry?

Vorbereitung zum Entpacken von .../ucslint_8.0.0-14A~4.4.0.202005210708_all.deb ...
Entpacken von ucslint (8.0.0-14A~4.4.0.202005210708) über (8.0.0-13A~4.4.0.201905211505) ...
dpkg: Fehler beim Bearbeiten des Archivs /var/cache/apt/archives/ucslint_8.0.0-14A~4.4.0.202005210708_all.deb (--unpack):
 Versuch, »/usr/lib/python3/dist-packages/univention/ucslint/0007-Changelog.py« zu überschreiben, welches auch in Paket ucslint-univention 8.0.0-13A~4.4.0.201905211505 ist
Fehler traten auf beim Bearbeiten von:
 /var/cache/apt/archives/ucslint_8.0.0-14A~4.4.0.202005210708_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Comment 4 Florian Best univentionstaff 2020-05-25 11:56:30 CEST
# ucslint
Traceback (most recent call last):
  File "/usr/bin/ucslint", line 381, in <module>
    main()
  File "/usr/bin/ucslint", line 374, in main
    incident_cnt, exitcode_cnt = chk.printResult(ignore_IDs, display_only_IDs, options.display_only_categories, options.exitcode_categories, options.junit_xml)
  File "/usr/bin/ucslint", line 187, in printResult
    tc = msg.junit()
  File "/usr/lib/python3/dist-packages/univention/ucslint/base.py", line 114, in junit
    tc = TestCase(self.id, stdout=self.msg, file=self.filename, line=self.line)
TypeError: __init__() got an unexpected keyword argument 'line'

python3-junit.xml:
  Installiert:           1.7-1
  Installationskandidat: 1.7-1
  Versionstabelle:
 *** 1.7-1 500
        500 http://updates.knut.univention.de/4.3/unmaintained 4.3-0/all/ Packages
Comment 5 Florian Best univentionstaff 2020-05-25 15:36:03 CEST
OK: the rest is fine.
Comment 6 Philipp Hahn univentionstaff 2020-05-26 05:22:55 CEST
(In reply to Florian Best from comment #3)
> There is an error during package upgrade: Maybe missing some "Breaks" entry?

[4.4-4] 98512275d5 Bug #49704 ucslint: Re-introduce ucslint-univention
 packaging/ucslint/debian/changelog       |  6 ++++++
 packaging/ucslint/debian/control         | 16 ++++++++++++++++
 packaging/ucslint/debian/ucslint.install |  1 +
 3 files changed, 23 insertions(+)

(In reply to Florian Best from comment #4)
> TypeError: __init__() got an unexpected keyword argument 'line'
> 
> python3-junit.xml:
>   Installiert:           1.7-1

[4.4-4] 09e7be5b11 Bug #49704 ucslint: Add JUnit XML support
 packaging/ucslint/setup.cfg                  | 4 ++--
 packaging/ucslint/univention/ucslint/base.py | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

Package: ucslint
Version: 8.0.0-15A~4.4.0.202005260513
Branch: ucs_4.4-0
Scope: errata4.4-4
Comment 7 Florian Best univentionstaff 2020-05-26 11:58:50 CEST
OK: transitional package
OK: junit
Comment 8 Florian Best univentionstaff 2020-06-22 13:40:05 CEST
*** Bug 46553 has been marked as a duplicate of this bug. ***
Comment 9 Erik Damrose univentionstaff 2020-06-24 12:52:56 CEST
<http://errata.software-univention.de/ucs/4.4/630.html>