Trying to package this project

Bug #1850054 reported by Olaf Seibert
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qbrz
In Progress
Medium
Unassigned

Bug Description

Hi again, I was trying to package this project as well (to replace qbzr), but I ran into various difficulties:

- There is no distfile published for this project (at least I could not find one);
- It is for Python 2 only, which is basically EOL (so we're trying to get rid of it);
- It is for Qt 4 only, which is EOL (so we're trying to get rid of it).

I made a start with converting to Python 3.7 by simply running the whole thing through 2to3-3.7, and published my result at bzr+ssh://bazaar.launchpad.net/~rhialto/qbzr/fix-python-etc/ (http://bazaar.launchpad.net/~rhialto/qbzr/fix-python-etc/changes). (It seems I mistyped bzr for brz, that will happen a lot I guess)

Unfortunately then I ran into what look like Qt4 problems, and I know just about nothing about Qt. So now I'm stuck.

.../other/qbrz/fix-python-etc$ brz qlog
brz: ERROR: TypeError: PyQt4.QtCore.QVariant represents a mapped type and cannot be instantiated

Traceback (most recent call last):
  File "/usr/pkg/lib/python3.7/site-packages/breezy/plugins/qbrz/lib/commands.py", line 176, in run
    ret_code = self._qbrz_run(*args, **kwargs)
  File "/usr/pkg/lib/python3.7/site-packages/breezy/plugins/qbrz/lib/commands.py", line 518, in _qbrz_run
    no_graph=no_graph, show_trees=show_trees)
  File "/usr/pkg/lib/python3.7/site-packages/breezy/lazy_import.py", line 117, in __call__
    return obj(*args, **kwargs)
  File "/usr/pkg/lib/python3.7/site-packages/breezy/plugins/qbrz/lib/log.py", line 159, in __init__
    QtCore.QVariant(self.FilterMessageRole))
TypeError: PyQt4.QtCore.QVariant represents a mapped type and cannot be instantiated

brz 3.0.1 on python 3.7.4 (NetBSD-8.1-amd64-x86_64-64bit-ELF)
arguments: ['/usr/pkg/bin/brz', 'qlog']
plugins: bash_completion[3.0.1], changelog_merge[3.0.1],
    commitfromnews[unknown], cvs[3.0.1], darcs[unknown], email[unknown],
    fastimport[unknown], launchpad[3.0.1], mtn[3.0.1],
    netrc_credential_store[3.0.1], news_merge[3.0.1], po_merge[3.0.1],
    propose[unknown], qbrz[0.23.2], repodebug[unknown], stats[3.0.1],
    upload[3.0.1], weave_fmt[3.0.1]
encoding: 'iso8859-1', fsenc: 'iso8859-1', lang: None

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/brz/+filebug
    including this traceback and a description of the problem.

Revision history for this message
Olaf Seibert (rhialto) wrote :

I changed it to bzr+ssh://bazaar.launchpad.net/~rhialto/qbrz/fix-python-etc/ or https://code.launchpad.net/~rhialto/qbrz/fix-python-etc

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qbzr (Ubuntu):
status: New → Confirmed
Changed in qbzr (Debian):
status: Unknown → Fix Released
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

(dropping the qbzr bugs, which are unrelated to qbrz)

qbrz unfortunately is just a halfdone attempt to port qbzr to Breezy, which is why there are no published tarballs; it needs a real maintainer.

I'm happy to provide guidance on the Breezy/Python3 side of things, since I have experience with those. I can't really help on the Qt side.

no longer affects: qbzr (Debian)
no longer affects: qbzr (Ubuntu)
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I've added some notes about the state of the project to the project description.

Revision history for this message
Yasuyuki Furukawa (fryasu) wrote :

In Fedora 32, bazaar was replaced with breezy.

- fedoraproject.org: Changes/ReplaceBazaarWithBreezy
  https://fedoraproject.org/wiki/Changes/ReplaceBazaarWithBreezy

GUI design of qbzr is great for us, as well as bzr CLI. So, we tried
to use qbrz of fix-python-etc branch (revno 1531), but qbrz is down by
above same exception.

   brz: ERROR: TypeError: PyQt4.QtCore.QVariant represents a mapped
        type and cannot be instantiated

According to stackoverflow, QVariant is not available with Python3.

- stackoverflow: Python 3.5.1: QVariant represents a mapped type and
                 cannot be instantiated
  https://stackoverflow.com/questions/36840296/python-3-5-1-qvariant-represents-a-mapped-type-and-cannot-be-instantiated

Though I have few knowledge of PyQt, I created a poor patch to remove
the code depended on QVariant. And regenerated also lib/ui_*.py files
by "pyuic" command of PyQt 4.12.

Please see the attached patch file for detail.

In my PC of Fedora32 beta, by applying of this patch, some commands such
as "qlog" seems running well.

regards,

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Robert has fixed a large number of issues with qbrz on Python 3. Any chance you could try again with current trunk?

Revision history for this message
Olaf Seibert (rhialto) wrote :
Download full text (4.9 KiB)

That is some nice progress!

I built and installed the python37-Qt4 bindings. (Aside: it turned out that they conflict with the python27-Qt4 bindings, because it installs some files with the same name for both. I fixed that up in pkgsrc for Qt5. Fortunately, here the only user of python27-Qt4 was qbzr, so I won't bother doing the same work for py-Qt4 just yet).

I also updated the packaging of breezy to 3.1.0. I was a bit let astray by much higher version numbers already in the release notes, so I had to try out which version actually exists.

Then I tried "brz qlog" (which tends to be the GUI thing I use most, for basically all version control systems) in a directory where actually a repository exists. Indeed I got the window I'm used to.

There are of course some loose ends. I noticed that various subcommands need "patiencediff" which I do seem to have for python 2.7 in bzrlib. So I guess that needs to be added to breezy.

Also I tried "brz qlog" outside a repository, which gave me a spectactular stacktrace. I'm sure those are all small points that are already on a list somewhere :-)

(interestingly enough, in some directories I get the stack trace. In others I get a nice error message "brz: ERROR: Not a branch: "/mnt/vol1/rhialto/cvs/other/qbrz/"." So I thought I'd add the stack trace for reference:

murthe.10:.../pkgsrc/devel/breezy$ brz qlog
brz: ERROR: TypeError: __str__ returned non-string (type CVSDirFormat)

Traceback (most recent call last):
  File "/usr/pkg/lib/python3.7/site-packages/breezy/plugins/qbrz/lib/trace.py",
line 378, in reports_exception_decorate
    return f(*args, **kargs)
  File "/usr/pkg/lib/python3.7/site-packages/breezy/plugins/qbrz/lib/log.py", line 244, in load
    branches, primary_bi, file_ids = self.get_branches_and_file_ids()
  File "/usr/pkg/lib/python3.7/site-packages/breezy/plugins/qbrz/lib/log.py", line 285, in get_branches_and_file_ids
    tree, br, repo, fp = ControlDir.open_containing_tree_branch_or_repository(location)
  File "/usr/pkg/lib/python3.7/site-packages/breezy/controldir.py", line 852, in open_containing_tree_branch_or_repository
    controldir, relpath = klass.open_containing(location)
  File "/usr/pkg/lib/python3.7/site-packages/breezy/controldir.py", line 773, in open_containing
    return klass.open_containing_from_transport(transport)
  File "/usr/pkg/lib/python3.7/site-packages/breezy/controldir.py", line 794, in open_containing_from_transport
    result = klass.open_from_transport(a_transport)
  File "/usr/pkg/lib/python3.7/site-packages/breezy/controldir.py", line 761, in open_from_transport
    format.check_support_status(_unsupported)
  File "/usr/pkg/lib/python3.7/site-packages/breezy/plugins/cvs/__init__.py", line 60, in check_support_status
    raise CVSUnsupportedError(self)
breezy.plugins.cvs.CVSUnsupportedError: <unprintable CVSUnsupportedError object>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/pkg/lib/python3.7/site-packages/breezy/plugins/qbrz/lib/util.py", line 956, in run_in_loading_queue
    f(*args, **kargs)
  File "/usr/pkg/lib/python3.7/site-packages/breezy/plugins/qbrz/lib/uifactory.py", li...

Read more...

Revision history for this message
Robert Ladyman (saccadic-masking) wrote :

Olaf, thanks for testing.

For the 'patiencediff' were there specific commands that failed?

Revision history for this message
Olaf Seibert (rhialto) wrote :

The case I ran into was with

$ brz qannotate README.md
brz: ERROR: No module named 'patiencediff'
You may need to install this Python library separately.

where it came with bzr:

$ pkg_info -L bzr|grep patiencediff
/usr/pkg/lib/python2.7/site-packages/bzrlib/_patiencediff_c.so
/usr/pkg/lib/python2.7/site-packages/bzrlib/_patiencediff_py.py
/usr/pkg/lib/python2.7/site-packages/bzrlib/_patiencediff_py.pyc
/usr/pkg/lib/python2.7/site-packages/bzrlib/_patiencediff_py.pyo
/usr/pkg/lib/python2.7/site-packages/bzrlib/patiencediff.py
/usr/pkg/lib/python2.7/site-packages/bzrlib/patiencediff.pyc
/usr/pkg/lib/python2.7/site-packages/bzrlib/patiencediff.pyo

but not with breezy:

$ pkg_info -L breezy|grep patiencediff

I tried to see if I got an issue with "bzr qannotate" but it seems that subcommand didn't exist, so I can't compare.

If patiencediff now is now a separate python package, then when the time is there to make a pkgsrc package for qbrz, I'll simply make it depend on patiencediff. And create a package for that, since there isn't one now.

(I could install patiencediff with pip, so I guess that will be the way to go)

Revision history for this message
Robert Ladyman (saccadic-masking) wrote :

I re-checked and I had to install patiencediff separately (hooray for bash history). qannotate exists for me but if uninstall patiencediff I get:

 brz: ERROR: No module named 'patiencediff'
 You may need to install this Python library separately.

Did you get some other error as well? I did find one in qcommit which I've since fixed.

Revision history for this message
Robert Ladyman (saccadic-masking) wrote :

I've adjusted setup.py to use setuptools and added patiencediff and breezy (the latter pinned to 3.1.0).

Revision history for this message
Olaf Seibert (rhialto) wrote :

Nope, I got the same error as you, and nothing more.
Thanks!

Revision history for this message
Robert Ladyman (saccadic-masking) wrote :

I have converted trunk to PyQt5

Changed in qbrz:
status: New → In Progress
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.