Cython's IF statement for conditional compilation has been deprecated
in Cython 3.0 as documented at:
https://cython.readthedocs.io/en/latest/src/userguide/migrating_to_cy30.html#deprecation-of-def-if
The compile_time_env parameter was used to pass compile-time constants
(BUILD_DOC and UNAME_SYSNAME) to Cython's IF statements. Since we have
migrated away from Cython's IF statements, this parameter is no longer
needed:
- Platform-specific code now uses C preprocessor conditionals (#if
defined(__FreeBSD__)) directly in cdef extern blocks
- BUILD_DOC conditionals are handled via Tempita template processing
for .pyx files, not Cython's compile-time IF statements
Remove the compile_time_env parameter from all pybind setup.py files
(cephfs, rados, rbd, rgw) as it serves no purpose after the migration
to Cython 3.0-compatible approaches.
Also, take this opportunity to completely drop `compiler_directives`
which should have been removed in
0423b771.
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ:
ext_args = {}
cython_constants = dict(BUILD_DOC=True)
- cythonize_args = dict(compile_time_env=cython_constants)
+ cythonize_args = dict()
elif check_sanity():
ext_args = get_python_flags(['cephfs'])
cython_constants = dict(BUILD_DOC=False)
include_path = [os.path.join(os.path.dirname(__file__), "..", "rados")]
- cythonize_args = dict(compile_time_env=cython_constants,
- include_path=include_path)
+ cythonize_args = dict(include_path=include_path)
else:
sys.exit(1)
**ext_args
)
],
- # use "3str" when Cython 3.0 is available
- compiler_directives={'language_level': sys.version_info.major},
- compile_time_env=cython_constants,
build_dir=os.environ.get("CYTHON_BUILD_DIR", None),
),
classifiers=[
if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ:
ext_args = {}
cython_constants = dict(BUILD_DOC=True)
- cythonize_args = dict(compile_time_env=cython_constants)
+ cythonize_args = dict()
elif check_sanity():
ext_args = get_python_flags(['rados', 'rbd'])
cython_constants = dict(BUILD_DOC=False)
include_path = [os.path.join(os.path.dirname(__file__), "..", "rados")]
- cythonize_args = dict(compile_time_env=cython_constants,
- include_path=include_path)
+ cythonize_args = dict(include_path=include_path)
else:
sys.exit(1)
if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ:
ext_args = {}
cython_constants = dict(BUILD_DOC=True)
- cythonize_args = dict(compile_time_env=cython_constants)
+ cythonize_args = dict()
elif check_sanity():
ext_args = get_python_flags(['rados', 'rgw'])
cython_constants = dict(BUILD_DOC=False)
include_path = [os.path.join(os.path.dirname(__file__), "..", "rados")]
- cythonize_args = dict(compile_time_env=cython_constants,
- include_path=include_path)
+ cythonize_args = dict(include_path=include_path)
else:
sys.exit(1)
**ext_args
)
],
- compiler_directives={'language_level': sys.version_info.major},
build_dir=os.environ.get("CYTHON_BUILD_DIR", None),
**cythonize_args
),