Skip to content

libmambapy: Switch build backend to scikit-build-core #3802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=[0-9]*)$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
3 changes: 2 additions & 1 deletion dev/environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ dependencies:
- cryptography
- securesystemslib
# libmambapy build dependencies
- scikit-build
- scikit-build-core
- setuptools-scm
- pybind11-stubgen <1.0
Copy link
Author

@LecrisUT LecrisUT Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does conda still not have any integration with python build systems (PEP517)? Manually referencing them like this is very error-prone, particularly since some build dependencies are dynamically generated, setuptools-scm in this case.

# libmambapy dependencies
- python
Expand Down
1 change: 1 addition & 0 deletions libmambapy/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
libmambapy/bindings*
libmambapy.egg-info/
/src/libmambapy/version.py
21 changes: 10 additions & 11 deletions libmambapy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ find_package(pybind11 REQUIRED)

pybind11_add_module(
bindings
src/libmambapy/bindings/longpath.manifest
bindings/longpath.manifest
# Entry point to all submodules
src/libmambapy/bindings/bindings.cpp
bindings/bindings.cpp
# All bindings used to live in a global module
src/libmambapy/bindings/legacy.cpp
bindings/legacy.cpp
# Submodules
src/libmambapy/bindings/utils.cpp
src/libmambapy/bindings/specs.cpp
src/libmambapy/bindings/solver.cpp
src/libmambapy/bindings/solver_libsolv.cpp
bindings/utils.cpp
bindings/specs.cpp
bindings/solver.cpp
bindings/solver_libsolv.cpp
)
# TODO: remove when `SubdirData::cache_path()` is removed
if(
Expand All @@ -40,12 +40,11 @@ if(
)
# This file uses capturing structured bindings, which was fixed in C++20
set_source_files_properties(
src/libmambapy/bindings/legacy.cpp
PROPERTIES COMPILE_FLAGS -Wno-error=deprecated-declarations
bindings/legacy.cpp PROPERTIES COMPILE_FLAGS -Wno-error=deprecated-declarations
)
endif()

target_include_directories(bindings PRIVATE src/libmambapy/bindings)
target_include_directories(bindings PRIVATE bindings)

mamba_target_add_compile_warnings(bindings WARNING_AS_ERROR ${MAMBA_WARNING_AS_ERROR})

Expand All @@ -55,7 +54,7 @@ target_compile_features(bindings PRIVATE cxx_std_17)
# Installation

if(SKBUILD)
install(TARGETS bindings DESTINATION ${MAMBA_INSTALL_PYTHON_EXT_LIBDIR})
install(TARGETS bindings DESTINATION libmambapy)
else()
# WARNING: this default should probably not be used as it is but set externally by a proper
# Python packager tool
Expand Down
2 changes: 0 additions & 2 deletions libmambapy/MANIFEST.in

This file was deleted.

22 changes: 11 additions & 11 deletions libmambapy/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"scikit-build>=0.13",
"cmake>=3.18",
"ninja",
]
build-backend = "setuptools.build_meta"
requires = ["scikit-build-core", "pybind11"]
build-backend = "scikit_build_core.build"

[project]
name = "libmambapy"
Expand All @@ -26,9 +20,15 @@ keywords = ["mamba", "conda", "packaging"]
license = {text = "BSD-3-Clause"}
dependencies = []
dynamic = ["version"]
[projet.url]

[projet.urls]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[projet.urls]
[project.urls]

Documentation = "https://mamba.readthedocs.io"
Repository = "https://github.com/mamba-org/mamba/"

[tool.setuptools]
platforms = ["Windows", "Linux", "Mac OS X"]
[tool.scikit-build]
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
sdist.include = ["src/libmambapy/version.py"]

[tool.setuptools_scm]
root = "../"
write_to = "libmambapy/src/libmambapy/version.py"
43 changes: 0 additions & 43 deletions libmambapy/setup.py

This file was deleted.

5 changes: 0 additions & 5 deletions libmambapy/src/libmambapy/version.py

This file was deleted.

5 changes: 0 additions & 5 deletions libmambapy/src/libmambapy/version.py.tmpl

This file was deleted.

1 change: 0 additions & 1 deletion releaser.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
templates = {
"libmamba": "libmamba/include/mamba/version.hpp.tmpl",
"micromamba": "micromamba/src/version.hpp.tmpl",
"libmambapy": "libmambapy/src/libmambapy/version.py.tmpl",
}


Expand Down
Loading