summaryrefslogtreecommitdiffstats
path: root/src/pybind/rbd/setup.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-23 16:45:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-23 16:45:44 +0000
commit17d6a993fc17d533460c5f40f3908c708e057c18 (patch)
tree1a3bd93e0ecd74fa02f93a528fe2f87e5314c4b5 /src/pybind/rbd/setup.py
parentReleasing progress-linux version 18.2.2-0progress7.99u1. (diff)
downloadceph-17d6a993fc17d533460c5f40f3908c708e057c18.tar.xz
ceph-17d6a993fc17d533460c5f40f3908c708e057c18.zip
Merging upstream version 18.2.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/pybind/rbd/setup.py')
-rwxr-xr-xsrc/pybind/rbd/setup.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/pybind/rbd/setup.py b/src/pybind/rbd/setup.py
index 1f20c3ed4..eeb33c73d 100755
--- a/src/pybind/rbd/setup.py
+++ b/src/pybind/rbd/setup.py
@@ -14,6 +14,7 @@ else:
from distutils.ccompiler import new_compiler
from distutils.errors import CompileError, LinkError
from itertools import filterfalse, takewhile
+from packaging import version
import distutils.sysconfig
@@ -148,11 +149,22 @@ else:
sys.exit(1)
cmdclass = {}
+compiler_directives={'language_level': sys.version_info.major}
try:
from Cython.Build import cythonize
from Cython.Distutils import build_ext
+ from Cython import __version__ as cython_version
cmdclass = {'build_ext': build_ext}
+
+ # Needed for building with Cython 0.x and Cython 3 from the same file,
+ # preserving the same behavior.
+ # When Cython 0.x builds go away, replace this compiler directive with
+ # noexcept on rbd_callback_t and librbd_progress_fn_t (or consider doing
+ # something similar to except? -9000 on rbd_diff_iterate2() callback for
+ # progress callbacks to propagate exceptions).
+ if version.parse(cython_version) >= version.parse('3'):
+ compiler_directives['legacy_implicit_noexcept'] = True
except ImportError:
print("WARNING: Cython is not installed.")
@@ -197,7 +209,7 @@ setup(
**ext_args
)
],
- compiler_directives={'language_level': sys.version_info.major},
+ compiler_directives=compiler_directives,
build_dir=os.environ.get("CYTHON_BUILD_DIR", None),
**cythonize_args
),