[reportlab-users] ReportLab and PyPy
Robin Becker
robin at reportlab.com
Mon Nov 23 07:02:50 EST 2015
Marius,
as promised here are the errors I get with a late model pypy on ubuntu 14.04. I
can now pip install pillow and that works so these error are mostly OK.
The _renderPM imports obviously don't work as I'm running in pure python mode.
That covers 3 erros. Th co_filename errors relate to trying to figure out stuff
from the C python stack, so I'm not worried about those. Th last error relates
to testing an error message. Instead of "integer division or modulo by zero"
pypy seems to use "integer division by zeroException raised while importing
'unimportable': integer division by zero". So all these errors are explainable.
The extensions are not built.
> (rl-pypy)rptlab at denali:~/devel/rl-pypy/REPOS/reportlab/tests
> $ python
> Python 2.7.10 (5f8302b8bf9f, Nov 18 2015, 10:46:46)
> [PyPy 4.0.1 with GCC 4.8.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>>>
> (rl-pypy)rptlab at denali:~/devel/rl-pypy/REPOS/reportlab/tests
> $ python runAll.py
> ....................................E..............................................................................F.............................................E...........................EEEE.......E..................................
> ======================================================================
> ERROR: test8 (test_graphics_charts.ChartTestCase)
> text _text2Path
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_graphics_charts.py", line 420, in test8
> P=_text2Path('Hello World from font Times-Roman!',x=10,y=20,fontName='Times-Roman',fontSize=20,strokeColor=colors.blue,strokeWidth=0.1,fillColor=colors.red)
> File "/home/rptlab/devel/rl-pypy/site-packages/reportlab/graphics/charts/textlabels.py", line 80, in _text2Path
> fontSize=fontSize,anchor=anchor,truncate=truncate,pathReverse=pathReverse),**kwds)
> File "/home/rptlab/devel/rl-pypy/site-packages/reportlab/graphics/charts/textlabels.py", line 63, in _text2PathDescription
> from reportlab.graphics import renderPM, _renderPM
> File "/home/rptlab/devel/rl-pypy/site-packages/reportlab/graphics/renderPM.py", line 32, in <module>
> "see https://www.reportlab.com/software/opensource/rl-addons/"))
> ImportError: No module named _renderPM
> it may be the wrong version or badly installed!
>
> ======================================================================
> ERROR: test0 (test_graphics_barcode.BarcodeWidgetTestCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_graphics_barcode.py", line 34, in test0
> D.save(formats=formats,outDir=outDir,fnRoot=name)
> File "/home/rptlab/devel/rl-pypy/site-packages/reportlab/graphics/shapes.py", line 767, in save
> from reportlab.graphics import renderPM
> File "/home/rptlab/devel/rl-pypy/site-packages/reportlab/graphics/renderPM.py", line 32, in <module>
> "see https://www.reportlab.com/software/opensource/rl-addons/"))
> ImportError: No module named _renderPM
> it may be the wrong version or badly installed!
>
> ======================================================================
> ERROR: test0 (test_docstrings.DocstringTestCase)
> Test if functions have a doc string.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 134, in setUp
> self.objects = getModuleObjects(self.modules)
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 125, in getModuleObjects
> getObjects(objects,lookup,mName,modBn,module)
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 107, in getObjects
> getObjects(objects,lookup,mName,modBn,obj)
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 100, in getObjects
> if os.path.splitext(obj.__code__.co_filename)[0]==modBn:
> AttributeError: 'builtin-code' object has no attribute 'co_filename'
>
> ======================================================================
> ERROR: test1 (test_docstrings.DocstringTestCase)
> Test if classes have a doc string.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 134, in setUp
> self.objects = getModuleObjects(self.modules)
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 125, in getModuleObjects
> getObjects(objects,lookup,mName,modBn,module)
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 107, in getObjects
> getObjects(objects,lookup,mName,modBn,obj)
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 100, in getObjects
> if os.path.splitext(obj.__code__.co_filename)[0]==modBn:
> AttributeError: 'builtin-code' object has no attribute 'co_filename'
>
> ======================================================================
> ERROR: test2 (test_docstrings.DocstringTestCase)
> Test if methods have a doc string.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 134, in setUp
> self.objects = getModuleObjects(self.modules)
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 125, in getModuleObjects
> getObjects(objects,lookup,mName,modBn,module)
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 107, in getObjects
> getObjects(objects,lookup,mName,modBn,obj)
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 100, in getObjects
> if os.path.splitext(obj.__code__.co_filename)[0]==modBn:
> AttributeError: 'builtin-code' object has no attribute 'co_filename'
>
> ======================================================================
> ERROR: test3 (test_docstrings.DocstringTestCase)
> Test if modules have a doc string.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 134, in setUp
> self.objects = getModuleObjects(self.modules)
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 125, in getModuleObjects
> getObjects(objects,lookup,mName,modBn,module)
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 107, in getObjects
> getObjects(objects,lookup,mName,modBn,obj)
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_docstrings.py", line 100, in getObjects
> if os.path.splitext(obj.__code__.co_filename)[0]==modBn:
> AttributeError: 'builtin-code' object has no attribute 'co_filename'
>
> ======================================================================
> ERROR: test2 (test_graphics_render.RenderTestCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_graphics_render.py", line 30, in test2
> from reportlab.graphics.renderPM import test
> File "/home/rptlab/devel/rl-pypy/site-packages/reportlab/graphics/renderPM.py", line 32, in <module>
> "see https://www.reportlab.com/software/opensource/rl-addons/"))
> ImportError: No module named _renderPM
> it may be the wrong version or badly installed!
>
> ======================================================================
> FAIL: testRecursiveImportErrors (test_lib_utils.ImporterTestCase)
> check we get useful error messages
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/rptlab/devel/rl-pypy/REPOS/reportlab/tests/test_lib_utils.py", line 154, in testRecursiveImportErrors
> self.assertIn(reportlab.isPy3 and 'division by zero' or 'integer division or modulo by zero',str(e))
> AssertionError: 'integer division or modulo by zero' not found in "integer division by zeroException raised while importing 'unimportable': integer division by zero"
>
> ----------------------------------------------------------------------
> Ran 235 tests in 41.417s
>
> FAILED (failures=1, errors=7)
> (rl-pypy)rptlab at denali:~/devel/rl-pypy/REPOS/reportlab/tests
I have tries the same with the extensions built. I then see this
$ python runAll.py
....Segmentation fault (core dumped)
(rl-pypy)rptlab at denali:~/devel/rl-pypy/REPOS/reportlab/tests
so it seems there's some issue with our extensions.
I'm almost sure the issue is with _renderPM since I get a segfault with
test_graphics_render.py. With test_rl_accel.py I see errors related to trying to
import getrefcount which pypy presumably doesn't supply.
--
Robin Becker
More information about the reportlab-users
mailing list