-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TT-3780 Add fixes for Python 3.8/3.9 #3479
Conversation
working in python 3.9, tested in MacOS 10.15.7 |
@sredxny Nice! |
d1572a1
to
54bad27
Compare
@matiasinsaurralde lets finally merge it to one of upcoming patches. |
54bad27
to
af7c170
Compare
Rebased with latest |
af7c170
to
214ada0
Compare
214ada0
to
06b233f
Compare
API tests result: success ✅ |
API tests result: success ✅ |
@@ -296,14 +292,10 @@ func mapCalls() error { | |||
defer C.free(unsafe.Pointer(s_Py_DecRef)) | |||
C.Py_DecRef_ptr = C.Py_DecRef_f(C.dlsym(C.python_lib, s_Py_DecRef)) | |||
|
|||
s_PyTuple_ClearFreeList := C.CString("PyTuple_ClearFreeList") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matiasinsaurralde if we delete this aren't we breaking backwards compatibility with the old versions of py which use PyTuple_ClearFreeList
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it better to start receiving the python version in mapCalls
and ignore this code for >3.8 versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tbuchaillot We actually don't use PyTuple_ClearFreeList
in any of the codebase, but as it was removed in one of the Python 3.x., the map call was causing issues. It's safe to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think passing the version to mapCalls
is interesting but might not be required at this time, in case Python 4 ever lands and breaks any mapping, we can incorporate it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense @matiasinsaurralde 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! @matiasinsaurralde any idea how can we add test coverage to it? I mean like create a matrix and test that python plugin load on different python versions? what would this imply?
API tests result: failure 🚫 |
API tests result: success ✅ |
SonarCloud Quality Gate failed. |
/release to release-4 |
Working on it! Note that it can take a few minutes. |
* Remove deprecated function mapping "PyTuple_ClearFreeList", reference: https://docs.python.org/3.9/whatsnew/3.9.html?highlight=pytuple_clearfreelist Improve libdl error handler * Remove PyTuple_ClearFreeList dlpython helper * Display libdl errors when calling PythonInit * Use "--embed" flag when calling python-config, this was introduced in 3.8: https://docs.python.org/3.8/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build * dlpython: ensure backwards compatibility when calling python-config Co-authored-by: Tomas Buchaillot <[email protected]> (cherry picked from commit cc9fcd4)
@tbuchaillot Succesfully merged |
/release to release-4-lts |
Working on it! Note that it can take a few minutes. |
@tbuchaillot Succesfully merged |
* Remove deprecated function mapping "PyTuple_ClearFreeList", reference: https://docs.python.org/3.9/whatsnew/3.9.html?highlight=pytuple_clearfreelist Improve libdl error handler * Remove PyTuple_ClearFreeList dlpython helper * Display libdl errors when calling PythonInit * Use "--embed" flag when calling python-config, this was introduced in 3.8: https://docs.python.org/3.8/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build * dlpython: ensure backwards compatibility when calling python-config Co-authored-by: Tomas Buchaillot <[email protected]> (cherry picked from commit cc9fcd4)
API tests result: success ✅
Improve libdl error handler
Co-authored-by: Tomas Buchaillot [email protected] |
API tests result: skipped 🚫
Improve libdl error handler
Co-authored-by: Tomas Buchaillot [email protected] |
1 similar comment
API tests result: skipped 🚫
Improve libdl error handler
Co-authored-by: Tomas Buchaillot [email protected] |
I've found two breaking changes, first one is related to
PyTuple_ClearFreeList
which was removed, mentioned here. The mapping for this binding was autogenerated and because we're not using it should be safe to remove it frombinding.go
.The second change is related to the
python-config
tool, 3.8 modified the flags required to retrieve the library path, they suggest implementing the following behavior:More info here.
https://tyktech.atlassian.net/browse/TT-3780