Closed a-andreyev closed 5 years ago
Mostly a note for myself
In this configuration CMake unable to find python-3 on my system.
find_package(PythonInterp ${REQUIRED_PY} REQUIRED)
finds python 3 correctly, but I'm not sure if it is a correct replacement. The project compiles on works correctly.
Proposing to add both PythonLibrary
and PythonInterp
, checked with my configuration, seems ok. (Have problems with PYTHON_SHORT_VERSION
variable without PythonLibrary
req)
https://cmake.org/cmake/help/latest/module/FindPythonInterp.html says:
Deprecated since version 3.12: Use FindPython3, FindPython2 or FindPython instead.
https://cmake.org/cmake/help/latest/module/FindPython.html says:
This module looks preferably for version 3 of Python. If not found, version 2 is searched. To manage concurrent versions 3 and 2 of Python, use FindPython3 and FindPython2 modules rather than this one.
It seems that we need to use FindPython3
to ensure the correct python version.
I just verified that the generated code is almost identical to the python2 version. The only diff is in headers:
+<?xml version="1.0" ?><tp:spec ...>
-<?xml version="1.0" encoding="utf-8"?><tp:spec ...>
that is hundred percent fine :+1:
thanks! checked with FindPython3
, working for me, updated the commit
Guess what? https://github.com/TelepathyIM/telepathy-glib/commit/ff1eea1e3abdc78665bb8b72c65bb19c8b1084b3#diff-ff4e2dc4962dc25a1512353299992c8dR9 :open_mouth:
While verifying the python3 port I found that we didn't (ever?) build with glib tests support.
I think that in the long term we'll drop glib stuff from telepathy-qt (AFAIU it is used for service side because telepathy-qt had no service side API).
However, I would like to keep it working as much as possible for the next release.
I updated tools
from telepathy-glib (hey, we even have a cmake target for that!) and now we need to rebase your PR with the follow little adjustments:
message(STATUS)
is not needed anymore, because now we have FeatureSummary
.xincludator.py
.dbus-python
detection. After switching to find_package(Python3) we have no PYTHON_EXECUTABLE
variable. I would suggest to introduce our own variable, rather than change the usage of existed one; who knows, maybe one day it will become Python4.I think that the code should look like this one (this is what I tested):
# Find python version >= 3
find_package(Python3 REQUIRED)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
# Check for dbus-python
Fixes #28. Initial move with
2to3
, manual changes with package and dependent packages rebuilding check.