Extension compatibility with Python 2 and 3

DeepInfer and probably some other modules do not work in Slicer 4.11 due to python 3 incompatibility. [1]

I have made some changes to the code to make it compatible with python 3 but the problem is that it would not work in the previous Slicer versions including 4.10.

Is there any way to specify a specific git id in the s4ext file for Slicer v <=4.10 to support backward compatibility and master for v>=4.11?

[1] https://github.com/DeepInfer/Slicer-DeepInfer/issues/13

The factory build machines are no longer building Slicer 4.10 extensions so updates to https://github.com/Slicer/ExtensionsIndex/tree/4.10 won’t result in any changes. The current stable is the Slicer 4.11.20200930 snapshot. Updates for this new stable for the factory to build would be made to the s4ext in https://github.com/Slicer/ExtensionsIndex/tree/4.11.

If you want to support building the extension on your own for compatibility with Slicer 4.10 you can update your code checking slicer version such as slicer.app.majorVersion, slicer.app.minorVersion, and slicer.app.patchVersion.

2 Likes

If you don’t want to pollute your code with version checks then:

1 Like