Downgrade LIMITED_API_VERSION, if python3 is older than 3.6#24860
Merged
asmorkalov merged 1 commit intoopencv:4.xfrom Jan 17, 2024
Merged
Downgrade LIMITED_API_VERSION, if python3 is older than 3.6#24860asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov merged 1 commit intoopencv:4.xfrom
Conversation
6 tasks
1045e7a to
5c8df75
Compare
mshabunin
reviewed
Jan 15, 2024
cmake/OpenCVDetectPython.cmake
Outdated
| if(PYTHON3_LIMITED_API) | ||
| set(PYTHON3_LIMITED_API_VERSION "0x03060000" CACHE STRING "Minimal Python version for Limited API") | ||
| # set LIMITED API version that corresponds to current python version, if python3 is too old | ||
| if(${PYTHON}_VERSION_STRING VERSION_GREATER "3.5.999") |
Contributor
There was a problem hiding this comment.
Perhaps it would be more readable to use negative condition (+avoid docstring duplication):
set(_default_ver "0x03060000")
if(${PYTHON}_VERSION_STRING VERSION_LESS "3.6")
# fix for older pythons
set(_default_ver "0x030${PYTHON3_VERSION_MINOR}0000")
endif()
set(PYTHON3_LIMITED_API_VERSION ${_default_ver} CACHE STRING "Minimal Python version for Limited API")
mshabunin
approved these changes
Jan 15, 2024
Contributor
mshabunin
left a comment
There was a problem hiding this comment.
Overall looks good to me, except cosmetic comments.
Verified with Ubuntu 16:
-- Python 3:
-- Interpreter: /usr/bin/python3 (ver 3.5.2)
-- Libraries: /usr/lib/x86_64-linux-gnu/libpython3.5m.so (ver 3.5.2)
-- Limited API: YES (ver 0x03050000)
-- numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.11.0)
-- install path: lib/python3.5/site-packages/cv2/python-3
5c8df75 to
d87768b
Compare
b04b307 to
218c4fb
Compare
Contributor
|
It seems that you've reverted previous cosmetic fix while fixing unrelated change, was it intended? |
218c4fb to
985506c
Compare
Contributor
Author
|
@mshabunin @opencv-alalek I fixed the issue, please take a look. |
opencv-alalek
approved these changes
Jan 17, 2024
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #24773 (comment)
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.