• Dropping ibus-pinyin (or salvaging libpyzy)?

    From Boyuan Yang@21:1/5 to All on Wed Apr 29 06:00:01 2020
    [Please use debian-input-method@lists.debian.org as main discussion list]

    Dear all,

    TL;DR: Let's drop package ibus-pinyin from Debian since it implicitly (build- )depends on the unmaintained python2. If we want to save it, considerable amount of work need to be done.

    Details on the proposed removal of ibus-pinyin are as follows:

    The default pinyin input method for ibus used to be ibus-pinyin[1] and its upstream is https://github.com/ibus/ibus-pinyin/ . However, in recent years
    the development shifts towards the libpinyin project, which provides ibus- libpinyin[2] at https://github.com/libpinyin/ibus-libpinyin . The old ibus- pinyin package was deprecated but not removed since someone may still prefer
    to use it.

    However, ibus-pinyin depends on libpyzy[3], a conversion library between
    pinyin and bopomofo (a.k.a. zhuyin). This library has a dead upstream at https://github.com/hsumita/libpyzy , which was exported from googlecode and
    has no activity in the last 10 years. This library heavily depends on some python2 scripts.

    Now that the ongoing Python2 removal transition[4] is likely to complete
    within the Bullseye cycle (you may find a progress chart here[5]), it's likely that the libpyzy library will need to be ported to Python3 or dropped together with ibus-pinyin, perhaps later this year.

    I'm wondering if anyone is interested in porting python2 scripts in libpyzy project. I had a really quick glance and have an estimation that it will probably requires 5 hours of porting and another 15 hours of testing to ensure a proper python3 migration if the developer has good experience in Python2->3 porting. Of course, another option is that we completely throw this library as well as ibus-pinyin away.

    P.S. I discussed it with the Arch Linux maintainer of ibus-pinyin/pyzy back in 2016 and 2018; the conclusion was to keep it at that time. Things have changed since then.

    Let me know if you have any thoughts. Volunteering would be highly welcome.

    --
    Regards,
    Boyuan Yang

    [1] https://tracker.debian.org/pkg/ibus-pinyin
    [2] https://tracker.debian.org/pkg/ibus-libpinyin
    [3] https://tracker.debian.org/pkg/libpyzy
    [4] https://release.debian.org/transitions/html/python2-rm.html
    [5] http://sandrotosi.me/debian/py2removal/py2removal_progress.png

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEfncpR22H1vEdkazLwpPntGGCWs4FAl6o+aQACgkQwpPntGGC Ws6OYg//QqCU5FuGGUxIBGPhDNgspvp/kSfxN0+QRAQy2mDz+seo8/ErT/W4uokX MqJgfjdQ0jLjCeHR4gsh57UFBWCWCAyfv/fyCa3wiVXi8cXrnfX007hGs0pyWHpl k3qYUA+HVZlvkoUQhwKhAZ9vE1R+hFBmVzi5OcfPuAkDULTushyK3qgnFcp9f6o+ ZoPVJYD3Yv/JCe9lgiFrkwdstoamBKZtBBml7xaRY7zATHp0+zgwRUcT+vQSbTuF ZbkdHqk3bL2ARemZd1CQwrukSOa7Mx4wCbTM9ceg1LD9hkv9xlFzWDnnMbSIVMSB C3hnv4lFyS4B6MncsWGxhm0IHy+SoF2dK3/8ZPjNw1Q6dFw5gBHNfGy5r5yBU5uK FHyyBMW0PSSZJjMTd7luBaisysIn3wXggbL/krTExZN4odF42clGPulnMKV7reZD iu870ZtmcGkQ8n7KUvLtdaU/7u2VkaO4Z5+nuljpqWlwyzaNVYEEgpCIH4Iy+6AH FjWc0toXoJWwGmNbdgXGfa5kHvir3St02AKefdRMOX8pPqoc8/qHCwMSe9kdqjp9 tc1yrMKxRBGj+tFOPlagWBc
  • From Kentaro Hayashi@21:1/5 to All on Wed Apr 29 09:00:01 2020
    Hi,

    FYI: I may be wrong because I didn't know well, but
    It seems that someone tried to port libpyzy scripts to python3.

    https://github.com/pyzy/pyzy/pull/4

    Regards,

    2020年4月29日(水) 15:06 Gunnar Hjalmarsson <gunnarhj@ubuntu.com>:

    On 2020-04-29 05:51, Boyuan Yang wrote:
    TL;DR: Let's drop package ibus-pinyin from Debian since it implicitly (build- )depends on the unmaintained python2. If we want to save it, considerable amount of work need to be done.

    FWIW I want to mention that porting ibus-pinyin itself to py3 isn't very hard. I did that last year as an experiment:

    https://launchpad.net/~gunnarhj/+archive/ubuntu/ibus-pinyin/+packages

    But the main obstacle seems to be libpyzy, which I have never looked at.

    --
    Gunnar Hjalmarsson
    https://launchpad.net/~gunnarhj



    --
    Kentaro Hayashi <kenhys@gmail.com>

    <div dir="ltr">Hi,<br><br>FYI: I may be wrong because I didn&#39;t know well, but<br>It seems that someone tried to port libpyzy scripts to python3.<br><div><br></div><div><a href="https://github.com/pyzy/pyzy/pull/4">https://github.com/pyzy/pyzy/pull/4</
    </div><br><div>Regards,</div><div><br></div>2020年4月29日(水) 15:06 Gunnar Hjalmarsson &lt;<a href="mailto:gunnarhj@ubuntu.com">gunnarhj@ubuntu.com</a>&gt;:<br>&gt;<br>&gt; On 2020-04-29 05:51, Boyuan Yang wrote:<br>&gt; &gt; TL;DR: Let&#39;s drop
    package ibus-pinyin from Debian since it implicitly<br>&gt; &gt; (build- )depends on the unmaintained python2. If we want to save it,<br>&gt; &gt; considerable amount of work need to be done.<br>&gt;<br>&gt; FWIW I want to mention that porting ibus-
    pinyin itself to py3 isn&#39;t very<br>&gt; hard. I did that last year as an experiment:<br>&gt;<br>&gt; <a href="https://launchpad.net/~gunnarhj/+archive/ubuntu/ibus-pinyin/+packages">https://launchpad.net/~gunnarhj/+archive/ubuntu/ibus-pinyin/+packages<
    <br>&gt;<br>&gt; But the main obstacle seems to be libpyzy, which I have never looked at.<br>&gt;<br>&gt; --<br>&gt; Gunnar Hjalmarsson<br>&gt; <a href="https://launchpad.net/~gunnarhj">https://launchpad.net/~gunnarhj</a><br>&gt;<br><br><br>--<br>
    Kentaro Hayashi &lt;<a href="mailto:kenhys@gmail.com">kenhys@gmail.com</a>&gt;</div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gunnar Hjalmarsson@21:1/5 to Boyuan Yang on Wed Apr 29 08:40:01 2020
    On 2020-04-29 05:51, Boyuan Yang wrote:
    TL;DR: Let's drop package ibus-pinyin from Debian since it implicitly
    (build- )depends on the unmaintained python2. If we want to save it, considerable amount of work need to be done.

    FWIW I want to mention that porting ibus-pinyin itself to py3 isn't very
    hard. I did that last year as an experiment:

    https://launchpad.net/~gunnarhj/+archive/ubuntu/ibus-pinyin/+packages

    But the main obstacle seems to be libpyzy, which I have never looked at.

    --
    Gunnar Hjalmarsson
    https://launchpad.net/~gunnarhj

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gunnar Hjalmarsson@21:1/5 to Kentaro Hayashi on Sun May 3 00:40:01 2020
    On 2020-04-29 08:37, Kentaro Hayashi wrote:
    FYI: I may be wrong because I didn't know well, but It seems that
    someone tried to port libpyzy scripts to python3.

    https://github.com/pyzy/pyzy/pull/4

    You are not wrong at all; the work has already been done, apparently.

    I tested it successfully and committed it as a patch to our repo.

    https://salsa.debian.org/input-method-team/libpyzy/-/commit/40dc6196

    So it looks like ibus-pinyin can stay in the archive for now. :)

    --
    Gunnar Hjalmarsson
    https://launchpad.net/~gunnarhj

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Boyuan Yang@21:1/5 to All on Sun May 3 03:50:01 2020
    Hi,

    在 2020-05-03星期日的 00:13 +0200,Gunnar Hjalmarsson写道:
    On 2020-04-29 08:37, Kentaro Hayashi wrote:
    FYI: I may be wrong because I didn't know well, but It seems that
    someone tried to port libpyzy scripts to python3.

    https://github.com/pyzy/pyzy/pull/4

    You are not wrong at all; the work has already been done, apparently.

    I tested it successfully and committed it as a patch to our repo.

    https://salsa.debian.org/input-method-team/libpyzy/-/commit/40dc6196

    So it looks like ibus-pinyin can stay in the archive for now. :)

    The package may not FTBFS, but the python script did not run successfully. There are trackbacks like this:

    make[5]: Entering directory '/<<PKGBUILDDIR>>/data/db/android'
    \
    rm -f android.db; \
    ./create_db.py ./rawdict_utf16_65105_freq.txt | /usr/bin/sqlite3 android.db || \
    ( rm -f android.db ; exit 1 )
    Traceback (most recent call last):
    File "./create_db.py", line 83, in <module>
    main()
    File "./create_db.py", line 80, in main
    create_db(sys.argv[1])
    File "./create_db.py", line 51, in create_db
    records = list(read_phrases(filename))
    File "./create_db.py", line 19, in read_phrases
    buf = file(filename).read()
    NameError: name 'file' is not defined

    I continued with more patching work to fix this certain issue https://salsa.debian.org/input-method-team/libpyzy/-/commit/736051f06ecb41aada4448f6b89413d5b18bfb46
    but that is not quite complete; it's still raising exceptions elsewhere. I'd expect more help from others on making this script runnable.

    --
    Thanks,
    Boyuan Yang

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEfncpR22H1vEdkazLwpPntGGCWs4FAl6uIoAACgkQwpPntGGC Ws7eRA/9EPOdOjLHr8LihBjFZCXUlDpxifjVMuQ1fR3W0pNo3iI0GjdQAZuL3Ldg +6OVFeDEDeIvvsAkSDli3u8CA1SVLtC9BSzXxW7KMfpBatBSAFhNm0UpLlwBk/OL 67u1fIYHUKJixv2sN+eDW0AfjizmPFwPAB9sNXK9aFUCQ6DR85idjFZ2RMAmIOPs 1Y8+691VCrUBdS9ro0mI7dyljj68GJ0tvlKEYxbMiQKpPOeYQcq48ZnW0/6aqZFK NLDoFfGHZO0v8myHe7WIEyZoxY2O5lvBIhPCRFO6L6Chx+hTDg+XXeYFVHJZj33M TRgVo43W4HIKEtMRLvA6Rsps4um7PgGuaOyDrpQZu/5oj/YXnxLnBKB/qZNT0Ft7 DzhL1SBlDInjAfHJGtzHVnZif++smGfAoFlhs5ISDCO8shrTg3xBUDr+dlqdvT9+ ZggG6s6S4rKaHNoB4+DJYOJr5tiZVwwAv6+NT3FyKiVjjDjcFf8jUgOEXIPrVKlM bxRlpl+8mP/0biTwlTE4+0putJ//AbZQ1FosQCaFVLpTKO5AD6XF0+aIoig/9XF/ 67l87AMvMjNQDjOoPPDNwTtJA5lAmpXuRAfg07K+Jzv2rm4ngtsDPzcHhpCC3ao8 CmeQtJ7LwcQhdq8WpnMaSmsb1Gy/BKCP6ovg1nleNS/m1iPUI9A=
    =9cWZ
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gunnar Hjalmarsson@21:1/5 to Boyuan Yang on Mon May 4 03:30:01 2020
    On 2020-05-03 03:46, Boyuan Yang wrote:
    在 2020-05-03星期日的 00:13 +0200,Gunnar Hjalmarsson写道:
    https://salsa.debian.org/input-method-team/libpyzy/-/commit/40dc6196

    So it looks like ibus-pinyin can stay in the archive for now. :)

    The package may not FTBFS, but the python script did not run successfully. There are trackbacks like this:

    make[5]: Entering directory '/<<PKGBUILDDIR>>/data/db/android'
    \
    rm -f android.db; \
    ./create_db.py ./rawdict_utf16_65105_freq.txt | /usr/bin/sqlite3 android.db ||
    \
    ( rm -f android.db ; exit 1 )
    Traceback (most recent call last):
    File "./create_db.py", line 83, in <module>
    main()
    File "./create_db.py", line 80, in main
    create_db(sys.argv[1])
    File "./create_db.py", line 51, in create_db
    records = list(read_phrases(filename))
    File "./create_db.py", line 19, in read_phrases
    buf = file(filename).read()
    NameError: name 'file' is not defined

    I continued with more patching work to fix this certain issue https://salsa.debian.org/input-method-team/libpyzy/-/commit/736051f06ecb41aada4448f6b89413d5b18bfb46
    but that is not quite complete; it's still raising exceptions elsewhere. I'd expect more help from others on making this script runnable.

    Ouch, apparently it was too good to be true. :(

    As regards that sort() function, I made an attempt in this MR:

    https://salsa.debian.org/input-method-team/libpyzy/-/merge_requests/1

    But then it really FTBFS:

    Error: near line 21: unrecognized token: "\"
    Error: near line 22: unrecognized token: "\"

    (and tens of thousands of similar messages...)

    It should be noted, though, that I get those error messages also by
    simply commenting the sort() function, so they seem to be caused by code running after that function.

    As a side note I can mention that it also FTBFS for me due to this commit:

    https://salsa.debian.org/input-method-team/libpyzy/-/commit/b1d8ffe7

    --
    Gunnar Hjalmarsson
    https://launchpad.net/~gunnarhj

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gunnar Hjalmarsson@21:1/5 to All on Mon May 4 20:40:02 2020
    I asked the author of the first patch, Martin Jansa, to take a look.

    https://github.com/shr-project/pyzy/pull/1

    Let's see.

    (Anybody with the right skill is of course encouraged to step in and
    help out.)

    --
    Gunnar Hjalmarsson
    https://launchpad.net/~gunnarhj

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)