From fca85a7b3879787637031168f3689629e4858c8a Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 21 Mar 2024 18:51:18 +0200 Subject: [PATCH] nanobind: use cpython from Conan --- recipes/nanobind/all/conanfile.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/recipes/nanobind/all/conanfile.py b/recipes/nanobind/all/conanfile.py index 3c50a065775ca..c845b18d0c584 100644 --- a/recipes/nanobind/all/conanfile.py +++ b/recipes/nanobind/all/conanfile.py @@ -29,7 +29,7 @@ class PackageConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "stable_abi": False, # FIXME: should be True by default + "stable_abi": False, # TODO: enable after CPython 3.12 is available "domain": None, } @@ -59,9 +59,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("tsl-robin-map/1.2.1") - # FIXME: add cpython dependency - # self.requires("cpython/3.12.0") + self.requires("tsl-robin-map/1.2.2") + self.requires("cpython/3.10.0") def validate(self): if self.settings.compiler.cppstd: @@ -71,7 +70,11 @@ def validate(self): raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - # FIXME: need to check that we are using CPython 3.12+ for self.options.stable_abi + + if self.options.stable_abi and Version(self.dependencies["cpython"].ref.version) < "3.12": + raise ConanInvalidConfiguration( + f"CPython 3.12+ is required for stable ABI support." + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True)