kou commented on code in PR #43606:
URL: https://github.com/apache/arrow/pull/43606#discussion_r1710496023
##########
cpp/cmake_modules/UseCython.cmake:
##########
@@ -184,4 +184,24 @@ function(cython_add_module _name pyx_target_name
generated_files)
add_dependencies(${_name} ${pyx_target_name})
endfunction()
+execute_process(COMMAND ${PYTHON_EXECUTABLE} -m cython --version
+ OUTPUT_VARIABLE CYTHON_version_output
+ ERROR_VARIABLE CYTHON_version_error
+ RESULT_VARIABLE CYTHON_version_result
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE)
+if(NOT ${CYTHON_version_result} EQUAL 0)
+ set(_error_msg "Command \"${PYTHON_EXECUTABLE} -m cython --version\" failed
with")
+ set(_error_msg "${_error_msg} output:\n${CYTHON_version_error}")
+ message(SEND_ERROR "${_error_msg}")
+else()
+ if("${CYTHON_version_output}" MATCHES "^[Cc]ython version ([^,]+)")
+ set(CYTHON_VERSION "${CMAKE_MATCH_1}")
+ else()
+ if("${CYTHON_version_error}" MATCHES "^[Cc]ython version ([^,]+)")
+ set(CYTHON_VERSION "${CMAKE_MATCH_1}")
+ endif()
+ endif()
+endif()
Review Comment:
> It's "semi-required" for the free-threaded build of 3.13.
OK. Can we require Cython 3.1.0a0 or later for Python 3.13 and we always
enable the flag with Python 3.13?
> I'd rather have the CI fail than not notice that some option is disabled.
Can we check it by an unit test?
In general, I want to keep CMake related code as simple as possible for easy
to maintain.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]