Skip to content

Commit 9872bed

Browse files
LecrisUTAntoinePrv
andauthored
libmambapy: Switch build backend to scikit-build-core (#3802)
Signed-off-by: Cristian Le <git@lecris.dev> Co-authored-by: AntoinePrv <AntoinePrv@users.noreply.github.com>
1 parent 2b643d1 commit 9872bed

20 files changed

+39
-72
lines changed

.github/workflows/brew.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ jobs:
3535
- name: Checkout mamba repository
3636
uses: actions/checkout@v4
3737

38+
# Note: cmake already installed from a local Github tap
39+
# Attempting to install it from homebrew/core creates a conflict without more handling
3840
- name: Install host and build dependencies
39-
run: brew install fmt libarchive libsolv lz4 openssl@3 reproc simdjson xz yaml-cpp zstd cmake cli11 nlohmann-json spdlog tl-expected pkgconfig python
41+
run: >
42+
brew install --overwrite
43+
fmt libarchive libsolv lz4 openssl@3 reproc simdjson xz yaml-cpp zstd
44+
cli11 nlohmann-json spdlog tl-expected pkgconfig python
4045
4146
- name: Configure to build mamba
4247
run: >

dev/environment-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dependencies:
5050
- cryptography
5151
- securesystemslib
5252
# libmambapy build dependencies
53-
- scikit-build
53+
- scikit-build-core
5454
# libmambapy dependencies
5555
- python
5656
- pybind11<3.0.0

libmamba/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,7 @@ configure_package_config_file(
782782
# Configure 'mambaConfig.cmake' for an install tree
783783
set(MAMBA_CONFIG_CODE "")
784784
configure_package_config_file(
785-
${PROJECT_NAME}Config.cmake.in
786-
"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}Config.cmake"
785+
${PROJECT_NAME}Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
787786
INSTALL_DESTINATION ${LIBMAMBA_CMAKECONFIG_INSTALL_DIR}
788787
)
789788

@@ -793,7 +792,7 @@ write_basic_package_version_file(
793792
COMPATIBILITY AnyNewerVersion
794793
)
795794
install(
796-
FILES ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}Config.cmake
795+
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
797796
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
798797
DESTINATION ${LIBMAMBA_CMAKECONFIG_INSTALL_DIR}
799798
)
@@ -804,3 +803,4 @@ install(
804803
DESTINATION ${LIBMAMBA_CMAKECONFIG_INSTALL_DIR}
805804
COMPONENT Mamba_Development
806805
)
806+
export(EXPORT ${PROJECT_NAME}Targets NAMESPACE mamba::)

libmambapy/CMakeLists.txt

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ find_package(pybind11 REQUIRED)
2121

2222
pybind11_add_module(
2323
bindings
24-
src/libmambapy/bindings/longpath.manifest
24+
bindings/longpath.manifest
2525
# Entry point to all submodules
26-
src/libmambapy/bindings/bindings.cpp
26+
bindings/bindings.cpp
2727
# All bindings used to live in a global module
28-
src/libmambapy/bindings/legacy.cpp
28+
bindings/legacy.cpp
2929
# Submodules
30-
src/libmambapy/bindings/utils.cpp
31-
src/libmambapy/bindings/specs.cpp
32-
src/libmambapy/bindings/solver.cpp
33-
src/libmambapy/bindings/solver_libsolv.cpp
30+
bindings/utils.cpp
31+
bindings/specs.cpp
32+
bindings/solver.cpp
33+
bindings/solver_libsolv.cpp
3434
)
3535
# TODO: remove when `SubdirData::cache_path()` is removed
3636
if(
@@ -40,12 +40,11 @@ if(
4040
)
4141
# This file uses capturing structured bindings, which was fixed in C++20
4242
set_source_files_properties(
43-
src/libmambapy/bindings/legacy.cpp
44-
PROPERTIES COMPILE_FLAGS -Wno-error=deprecated-declarations
43+
bindings/legacy.cpp PROPERTIES COMPILE_FLAGS -Wno-error=deprecated-declarations
4544
)
4645
endif()
4746

48-
target_include_directories(bindings PRIVATE src/libmambapy/bindings)
47+
target_include_directories(bindings PRIVATE bindings)
4948

5049
mamba_target_add_compile_warnings(bindings WARNING_AS_ERROR ${MAMBA_WARNING_AS_ERROR})
5150

@@ -62,7 +61,7 @@ set_target_properties(
6261
# Installation
6362

6463
if(SKBUILD)
65-
install(TARGETS bindings DESTINATION ${MAMBA_INSTALL_PYTHON_EXT_LIBDIR})
64+
install(TARGETS bindings DESTINATION libmambapy)
6665
else()
6766
# WARNING: this default should probably not be used for installation but only for local
6867
# development and testing. Proper installation should be controlled externally by a Python

libmambapy/MANIFEST.in

Lines changed: 0 additions & 2 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)