sip-build fails with AttributeError

Guðjón Guðjónsson gudjon.i.gudjonsson at gmail.com
Sat Feb 18 09:17:12 GMT 2023


Hi again list

Finally PyQt-Qwt builds for Qwt 6.1.4 (Qt5), 6.1.6 (Qt5) and 6.2.0 (Qt5 and
Qt6)

But I am pretty sure I have found a bug in sip-build 6.7.7.

I changed my class definition from
class QwtAbstractLegend : QFrame
to
class QwtAbstractLegend : QFrames
to create an error.

When compiling with sip-build 6.7.7 I get the error below that gives no
relevant information [1]
But sip-build 6.6.2 gives the following output:

These bindings will be built: Qwt.
Generating the Qwt bindings...
sip-build: ::QFrames has not been defined

Which is useful for me.

And the other problem is:

That the code:
%If(- Qwt_6_1_6)
class QwtAbstractScaleDraw

doesn't work.
If I set
tag = Qwt_6_1_5
in project.py, it works perfectly.
I have this problem with both sip-tools 6.6.2 and 6.7.7 but the error
message is better
from 6.6.2.

Regards
Gudjon







[1]
These bindings will be built: Qwt.
Generating the Qwt bindings...
sip-build: An internal error occurred...
Traceback (most recent call last):
  File "/usr/bin/sip-build", line 33, in <module>
    sys.exit(load_entry_point('sip==6.7.7', 'console_scripts',
'sip-build')())

 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/sipbuild/tools/build.py", line 37,
in main
    handle_exception(e)
  File "/usr/lib/python3/dist-packages/sipbuild/exceptions.py", line 81, in
handle_exception
    raise e
  File "/usr/lib/python3/dist-packages/sipbuild/tools/build.py", line 34,
in main
    project.build()
  File "/usr/lib/python3/dist-packages/sipbuild/project.py", line 244, in
build
    self.builder.build()
  File "/usr/lib/python3/dist-packages/sipbuild/builder.py", line 48, in
build
    self._generate_bindings()
  File "/usr/lib/python3/dist-packages/sipbuild/builder.py", line 277, in
_generate_bindings
    buildable = bindings.generate()
                ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/sipbuild/bindings.py", line 172, in
generate
    resolve(spec, modules)
  File
"/usr/lib/python3/dist-packages/sipbuild/generator/resolver/resolver.py",
line 94, in resolve
    _set_mro(spec, klass, error_log)
  File
"/usr/lib/python3/dist-packages/sipbuild/generator/resolver/resolver.py",
line 725, in _set_mro
    _set_mro(spec, superklass, error_log, seen=seen)
  File
"/usr/lib/python3/dist-packages/sipbuild/generator/resolver/resolver.py",
line 763, in _set_mro
    klass.metatype = klass.iface_file.module.default_metatype
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'default_metatype'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20230218/5a7709d1/attachment.htm>


More information about the PyQt mailing list