Skip to content

Python 3 Compatibility Updates, master branch (2019.10.04.)

This is a first stab at making our projects work correctly with Python 3.

The FindPythonInterp.cmake and FindPythonLibs.cmake files were updated to rely on CMake's FindPython.cmake or FindPython2.cmake modules. As those are the "modern ways" of using Python from CMake these days.

The updated modules include a new flag, ATLAS_FORCE_PYTHON2. When set to true, this forces the configuration to insist on using Python 2, even if Python 3 is also available. (This may become useful at one point. I've had to do this while building Gaudi/Athena code on Ubuntu 18.04 in the past.)

Note that eventually we will probably want to add a FindPython.cmake wrapper in AtlasLCG as well. I'm just not quite sure yet how to do that... And in any case, all of this repository and atlas/athena only use the old modules for now anyway.

Finally, I also had to make a small change in PyModules to make it build against Python 3. Since @fwinkl was very keen on using REQUIRED in that configuration (as it seems...), I added a version check to the code. But it may have been more robust to actually just remove the REQUIRED keywords, and not care about the concrete version of Python... I'm still pondering about doing that in the future...

This is all to work towards ATLINFR-3221...

Merge request reports