[PyQt] sip snapshot problem with PyQwt

Hans-Peter Jansen hpj at urpla.net
Mon Nov 15 00:27:34 GMT 2010


On Sunday 14 November 2010, 13:13:55 Phil Thompson wrote:
> On Sun, 14 Nov 2010 00:33:38 +0100, "Hans-Peter Jansen"
> <hpj at urpla.net>
>
> wrote:
> > Hi Phil, hi Gerard,
> >
> > in an attempt to build PyQwt with the current sip snapshot
>
> (c38668e9dd93),
>
> > sip fails with a strange error:
> >
> > /usr/bin/sip -I /usr/share/sip/PyQt4 -b tmp-qwt5qt4/qwt5qt4.sbf -c
> > tmp-qwt5qt4
> >  -x VendorID -t WS_X11 -x PyQt_NoPrintRangeBug -t Qt_4_7_1 -x Py_v3
> > -g -x HAS_PYQT_031105 -x HAS_QWT4 -x HAS_QWT_SVG -t Qwt_5_2_0
> > ../sip/qwt5qt4/QwtModule.sip
> > sip: No %Module has been specified for module defined in
> > /usr/share/sip/PyQt4/QtSvg/QtSvgmod.sip
> > SIP failed to generate the C++ code.
> >
> > The PyQwt package is also a snapshot build, all files are available
>
> here:
>
>
> https://build.opensuse.org/package/files?package=python-qwt5&project=
>home%3Afrispete%3APyQt-next
>
> > The sip files (from PyQt-x11-gpl-snapshot-4.8.2-634f8a2612bf) are
> > installed
> > properly and /usr/share/sip/PyQt4/QtSvg/QtSvgmod.sip looks fine to
> > my untrained eye:
> >
> > cat /usr/share/sip/PyQt4/QtSvg/QtSvgmod.sip
> > // QtSvgmod.sip generated by MetaSIP on Thu Nov 11 03:43:29 2010
> > //
> > // This file is part of the QtSvg Python extension module.
> > //
> > // Copyright (c) 2010 Riverbank Computing Limited
> > <info at riverbankcomputing.com>
> > //
> > // This file is part of PyQt.
> > //
> > // This file may be used under the terms of the GNU General Public
> > // License versions 2.0 or 3.0 as published by the Free Software
> > // Foundation and appearing in the files LICENSE.GPL2 and
> > LICENSE.GPL3 // included in the packaging of this file. 
> > Alternatively you may (at // your option) use any later version of
> > the GNU General Public // License if such license has been publicly
> > approved by Riverbank // Computing Limited (or its successors, if
> > any) and the KDE Free Qt // Foundation. In addition, as a special
> > exception, Riverbank gives you // certain additional rights. These
> > rights are described in the
>
> Riverbank
>
> > // GPL Exception version 1.1, which can be found in the file
> > // GPL_EXCEPTION.txt in this package.
> > //
> > // Please review the following information to ensure GNU General
> > // Public Licensing requirements will be met:
> > // http://trolltech.com/products/qt/licenses/licensing/opensource/.
> > If // you are unsure which license is appropriate for your use,
> > please // review the following information:
> > //
> > http://trolltech.com/products/qt/licenses/licensing/licensingovervi
> >ew // or contact the sales department at
> > sales at riverbankcomputing.com. //
> > // This file is provided AS IS with NO WARRANTY OF ANY KIND,
> > INCLUDING
>
> THE
>
> > // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
> > PURPOSE.
> >
> >
> > %Module PyQt4.QtSvg 0
> >
> > %Import QtCore/QtCoremod.sip
> > %Import QtGui/QtGuimod.sip
> >
> > %Copying
> > Copyright (c) 2010 Riverbank Computing Limited
> > <info at riverbankcomputing.com>
> >
> > This file is part of PyQt.
> >
> > This file may be used under the terms of the GNU General Public
> > License versions 2.0 or 3.0 as published by the Free Software
> > Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
> > included in the packaging of this file.  Alternatively you may (at
> > your option) use any later version of the GNU General Public
> > License if such license has been publicly approved by Riverbank
> > Computing Limited (or its successors, if any) and the KDE Free Qt
> > Foundation. In addition, as a special exception, Riverbank gives
> > you certain additional rights. These rights are described in the
> > Riverbank GPL Exception version 1.1, which can be found in the file
> > GPL_EXCEPTION.txt in this package.
> >
> > Please review the following information to ensure GNU General
> > Public Licensing requirements will be met:
> > http://trolltech.com/products/qt/licenses/licensing/opensource/. If
> > you are unsure which license is appropriate for your use, please
> > review the following information:
> > http://trolltech.com/products/qt/licenses/licensing/licensingovervi
> >ew or contact the sales department at sales at riverbankcomputing.com.
> >
> > This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
> > THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
> > PARTICULAR
>
> PURPOSE.
>
> > %End
> >
> > %DefaultSupertype sip.simplewrapper
> >
> > %Include qgraphicssvgitem.sip
> > %Include qsvggenerator.sip
> > %Include qsvgrenderer.sip
> > %Include qsvgwidget.sip
> >
> >
> > OTOH, the rest of the project (including PyKDE4!) is building just
> > fine with the current sip and PyQt4 snapshots:
>
> https://build.opensuse.org/project/monitor?project=home%3Afrispete%3A
>PyQt-next
>
> > Do you have an idea, what's going wrong or how to debug such an
> > issue?
>
> There have been changes to the parsing of %Module. One change is that
> %Module is now affected by %If/%End. Could that be the source of the
> problem?

I was able to fix a missing % from an End directive (attached), but the 
problem persists. 

Phil, PyQwt does use "sip -x HAS_QWT_SVG" and defines 
%If (HAS_QWT_SVG)
%Import QtSvg/QtSvgmod.sip
%End // HAS_QWT_SVG

If I understand this correctly, this should exclude the QtSvg module, 
but sip seems to use it anyway:

23559 open("/usr/share/sip/PyQt4/QtSvg/QtSvgmod.sip", O_RDONLY) = 4
23559 open("/usr/share/sip/PyQt4/QtSvg/qgraphicssvgitem.sip", O_RDONLY) 
= 5
23559 open("/usr/share/sip/PyQt4/QtSvg/qsvggenerator.sip", O_RDONLY) = 5
23559 open("/usr/share/sip/PyQt4/QtSvg/qsvgrenderer.sip", O_RDONLY) = 5
23559 open("/usr/share/sip/PyQt4/QtSvg/qsvgwidget.sip", O_RDONLY) = 5

Could it be, that sip, for some reason, includes these, and since 
HAS_QWT_SVG is set, cannot determine the module to be build?

$ egrep -i 'svg' sip/qwt5qt4/*.sip
sip/qwt5qt4/qwt_plot_item.sip:        Rtti_PlotSVG,
sip/qwt5qt4/qwt_plot_item.sip:#ifdef sipClass_QwtPlotSvgItem
sip/qwt5qt4/qwt_plot_item.sip:    case QwtPlotItem::Rtti_PlotSVG: 
sipClass = sipClass_QwtPlotSvgItem; break; 
sip/qwt5qt4/qwt_plot_item.sip:#endif // sipClass_QwtPlotSvgItem
sip/qwt5qt4/qwt_plot_item.sip:        Rtti_PlotSVG,
sip/qwt5qt4/qwt_plot_item.sip:#ifdef sipClass_QwtPlotSvgItem
sip/qwt5qt4/qwt_plot_item.sip:    case QwtPlotItem::Rtti_PlotSVG: 
sipClass = sipClass_QwtPlotSvgItem; break; 
sip/qwt5qt4/qwt_plot_item.sip:#endif // sipClass_QwtPlotSvgItem
sip/qwt5qt4/qwt_plot_svgitem.sip://      QwtPlotSvgItem.
sip/qwt5qt4/qwt_plot_svgitem.sip:class QwtPlotSvgItem: QwtPlotItem
sip/qwt5qt4/qwt_plot_svgitem.sip:#include <qwt_plot_svgitem.h>
sip/qwt5qt4/qwt_plot_svgitem.sip:    QwtPlotSvgItem(const QString& = 
QString::null);
sip/qwt5qt4/qwt_plot_svgitem.sip:    QwtPlotSvgItem(const QwtText&);
sip/qwt5qt4/qwt_plot_svgitem.sip:    virtual ~QwtPlotSvgItem();
sip/qwt5qt4/qwt_plot_svgitem.sip:    // signature: const QSvgRenderer& 
renderer() const;
sip/qwt5qt4/qwt_plot_svgitem.sip:    QSvgRenderer& renderer();
sip/qwt5qt4/qwt_plot_svgitem.sip:}; // class QwtPlotSvgItem

The QtSvg module might get pulled in via the QSvgRenderer in 
qwt_plot_svgitem.sip, or some such?

> > It might be Gerards fault, but the error looks pretty strange.
> >
> > While at it, I noticed, that you added a way to suppress the header
> > timestamps in sip. While this is goods news (may loose one ugly
> > patch in
> >
> > my builds, that ensures the results of unchanged rebuilds to be
> > exactly equal). However, in order to make use of this, it is
> > necessary to be
>
> able
>
> > to specify this option in PyQt4 builds (or even better, globally
> > disable it in sipconfig.py, unless somebody actively enables it..).
>
> So you need a similar option to PyQt's configure.py?

Yes, that would be nice (the global sip setting would be even nicer..).

Pete
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_qwt_plot.diff
Type: text/x-diff
Size: 350 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101115/5cd26e5a/attachment.diff>


More information about the PyQt mailing list