Update libraries versions

This commit is contained in:
2025-07-19 22:39:09 +02:00
parent bd31794240
commit 6761933581

View File

@@ -7,7 +7,7 @@ from conan.tools.files import copy
class PlatformConan(ConanFile): class PlatformConan(ConanFile):
name = "pyclassifiers" name = "pyclassifiers"
version = "1.0.3" version = "1.0.3"
# Binary configuration # Binary configuration
settings = "os", "compiler", "build_type", "arch" settings = "os", "compiler", "build_type", "arch"
options = { options = {
@@ -16,41 +16,40 @@ class PlatformConan(ConanFile):
default_options = { default_options = {
"enable_testing": False, "enable_testing": False,
} }
# Sources are located in the same place as this recipe, copy them to the recipe # Sources are located in the same place as this recipe, copy them to the recipe
exports_sources = "CMakeLists.txt", "pyclfs/*", "tests/*", "LICENSE" exports_sources = "CMakeLists.txt", "pyclfs/*", "tests/*", "LICENSE"
def set_version(self) -> None: def set_version(self) -> None:
cmake = pathlib.Path(self.recipe_folder) / "CMakeLists.txt" cmake = pathlib.Path(self.recipe_folder) / "CMakeLists.txt"
text = cmake.read_text(encoding="utf-8") text = cmake.read_text(encoding="utf-8")
match = re.search( match = re.search(
r"""project\s*\([^\)]*VERSION\s+([0-9]+\.[0-9]+\.[0-9]+)""", r"""project\s*\([^\)]*VERSION\s+([0-9]+\.[0-9]+\.[0-9]+)""",
text, re.IGNORECASE | re.VERBOSE text,
re.IGNORECASE | re.VERBOSE,
) )
if match: if match:
self.version = match.group(1) self.version = match.group(1)
else: else:
raise Exception("Version not found in CMakeLists.txt") raise Exception("Version not found in CMakeLists.txt")
self.version = match.group(1) self.version = match.group(1)
def requirements(self): def requirements(self):
self.requires("libtorch/2.7.0") self.requires("libtorch/2.7.1")
self.requires("nlohmann_json/3.11.3") self.requires("nlohmann_json/3.11.3")
self.requires("folding/1.1.1") self.requires("folding/1.1.2")
self.requires("fimdlp/2.1.0") self.requires("fimdlp/2.1.1")
self.requires("bayesnet/1.2.0") self.requires("bayesnet/1.2.1")
def build_requirements(self): def build_requirements(self):
self.tool_requires("cmake/[>=3.30]") self.tool_requires("cmake/[>=3.30]")
self.test_requires("catch2/3.8.1") self.test_requires("catch2/3.8.1")
self.test_requires("arff-files/1.2.0") self.test_requires("arff-files/1.2.1")
def layout(self): def layout(self):
cmake_layout(self) cmake_layout(self)
def generate(self): def generate(self):
deps = CMakeDeps(self) deps = CMakeDeps(self)
deps.generate() deps.generate()
@@ -61,22 +60,27 @@ class PlatformConan(ConanFile):
cmake = CMake(self) cmake = CMake(self)
cmake.configure() cmake.configure()
cmake.build() cmake.build()
if self.options.enable_testing: if self.options.enable_testing:
# Run tests only if we're building with testing enabled # Run tests only if we're building with testing enabled
self.run("ctest --output-on-failure", cwd=self.build_folder) self.run("ctest --output-on-failure", cwd=self.build_folder)
def package(self): def package(self):
copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) copy(
self,
"LICENSE",
src=self.source_folder,
dst=os.path.join(self.package_folder, "licenses"),
)
cmake = CMake(self) cmake = CMake(self)
cmake.install() cmake.install()
def package_info(self): def package_info(self):
self.cpp_info.libs = ["PyClassifiers"] self.cpp_info.libs = ["PyClassifiers"]
self.cpp_info.includedirs = ["include"] self.cpp_info.includedirs = ["include"]
self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_find_mode", "both")
self.cpp_info.set_property("cmake_target_name", "pyclassifiers::pyclassifiers") self.cpp_info.set_property("cmake_target_name", "pyclassifiers::pyclassifiers")
# Add compiler flags that might be needed # Add compiler flags that might be needed
if self.settings.os == "Linux": if self.settings.os == "Linux":
self.cpp_info.system_libs = ["pthread"] self.cpp_info.system_libs = ["pthread"]