Skip to content

Commit

Permalink
nanobind: use cpython from Conan
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Mar 21, 2024
1 parent 10ebcd5 commit fca85a7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions recipes/nanobind/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit fca85a7

Please sign in to comment.