[vtk-developers] Solutions to TestSetGet/TestEmptyInput failures on RogueResearch3

Andrew Maclean andrew.amaclean at gmail.com
Wed May 6 03:34:53 EDT 2015


Hi All,

RogueResearch is running Python 2.5.

Both TestSetGet.py and TestEmptyInput.py fail at this line:
    vtkClasses = inspect.getmembers(
                    vtk, inspect.isclass and not inspect.isabstract)
with this error:
    vtk, inspect.isclass and not inspect.isabstract)
AttributeError: 'module' object has no attribute 'isabstract'

Apparently the isabstract attribute was introduced in Python 2.6.

>From what I can see there are these options:

1) Skip these two tests by checking the version of Python used when VTK is
built.
2) Extend option 1 by by creating a global variables in
./Cmake/VTKConfig.cmake.
3) Do nothing, and hope Python 2.5 is eventually deprecated.

My preferred option is 2) as this could be useful when VTK supports Python
3 e.g it may be useful to know which version of Python VTK is wrapped with,
in the same way as we use VTK_QT_VERSION. If this is Ok I propose calling
it VTK_WRAPPING_PYTHON_VERSION to distinguish it from VTK_PYTHON_VERSION in
./CmakeLists.txt (which can have the values 2, 2.x, 3, 3.x etc).
VTK_WRAPPING_PYTHON_VERSION would be built from PYTHON_MAJOR_VERSION and
PYTHON_MINOR_VERSION which are defined in ./CMake/FindPythonLibs.cmake.
This would require just adding one line to ./CMake/VTKConfig.cmake.in,
something like this:
2.1)
SET(VTK_WRAPPING_PYTHON_VERSION "@PYTHON_MAJOR_VERSION@
. at PYTHON_MINOR_VERSION@")

or ... would it be better to simply just do this in this file, since these
are defined in ./Utilities/Python/vtkPythonConfigure.h.in?
2.2)
SET(VTK_PYTHON_MAJOR_VERSION "@VTK_PYTHON_MAJOR_VERSION @")
SET(VTK_PYTHON_MINOR_VERSION"@VTK_PYTHON_MINOR_VERSION@")

 I prefer option 2) and, on reflection, I would go with with 2.2)

Please let me know what you think would be the best option.

Regards
    Andrew


-- 
___________________________________________
Andrew J. P. Maclean

___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150506/fdd1d3d8/attachment.html>


More information about the vtk-developers mailing list