kdev-python: Use CMake FindPython3

Francis Herne mail at flherne.uk
Thu Jan 4 14:37:28 GMT 2024


On 2024-01-03 14:31, Casian Andrei wrote:
> Use FindPython3 instead of FindPythonInterp and FindPythonLibs
> 
> Fixes CMake warning regarding CMP0148 - deprecation of
> FindPythonInterp and FindPythonLibs.
> 
> Initially tested using a python3.12, but kdevelop crashes and there
> are kdev-python errors in the logs, so kept max version to 3.11.
> 
> Tested with a local compiled python3.9. When the python3.9 was
> compiled without --enable-shared, CMake didn't work, as expected. When
> compiled with --enable-shared, CMake worked fine. Built ok, but for
> some reason tried to link kdevpythonlanguagesupport.so to a
> nonexistent python3.11 library.
> 
> Installed a python3.11 which worked fine with kdevelop-python.
> 
> I assume that issue linking to a nonexistent python3.11 was not
> because of a problem with these changes.
> 
> ---
> 
> Because I haven't contributed to KDE for many years now, it would take
> a lot of time to get the accounts and setups and learn how things are
> done now.
> 
> I hope you are able to review and commit if ok.
> 
> Attaching the patch.

Thanks for the patch.

Nitpick: please use 3.11 as upper bound (assuming that works) rather 
than 3.11.7 in case there's another patch release. These are very 
unlikely to break kdev-python.
The dependency on 3.4.3 was due to a particularly stupid series of 
events that hopefully won't repeat.

I'm concerned that the "issue linking to a nonexistent python3.11" might 
be due to you having a Python 3.11 interpreter installed, but not with 
corresponding libs? This will explicitly fail with the old checks, where 
the comment is: "# Find libraries that match the found interpreter 
(mismatched versions not supported)."

If CMake's new FindPython3 is smart enough it would return the highest 
version matching both required components, but I've learned to have very 
little faith in CMake modules doing the right thing in non-obvious 
situations.

Yours,
-Francis Herne


More information about the KDevelop-devel mailing list