Skip to content

Commit

Permalink
Replace confusing names
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Nov 10, 2023
1 parent a554b27 commit c49d3eb
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
20 changes: 10 additions & 10 deletions libmambapy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ find_package(Python COMPONENTS Interpreter Development)
find_package(pybind11 REQUIRED)

pybind11_add_module(
core
src/libmambapy/core/longpath.manifest
src/libmambapy/core/core.cpp
src/libmambapy/core/main.cpp
bindings
src/libmambapy/bindings/longpath.manifest
src/libmambapy/bindings/bindings.cpp
src/libmambapy/bindings/legacy.cpp
)

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

mamba_target_add_compile_warnings(core WARNING_AS_ERROR ${MAMBA_WARNING_AS_ERROR})
mamba_target_add_compile_warnings(bindings WARNING_AS_ERROR ${MAMBA_WARNING_AS_ERROR})

target_link_libraries(core PRIVATE pybind11::pybind11 ${libmamba_target})
target_compile_features(core PRIVATE cxx_std_17)
target_link_libraries(bindings PRIVATE pybind11::pybind11 ${libmamba_target})
target_compile_features(bindings PRIVATE cxx_std_17)

# Installation

if(SKBUILD)
install(TARGETS core DESTINATION ${MAMBA_INSTALL_PYTHON_EXT_LIBDIR})
install(TARGETS bindings DESTINATION ${MAMBA_INSTALL_PYTHON_EXT_LIBDIR})
else()
# WARNING: this default should probably not be used as it is but set extranlly by a proper
# Python packager tool
Expand All @@ -51,7 +51,7 @@ else()
)

install(
TARGETS core
TARGETS bindings
EXCLUDE_FROM_ALL
COMPONENT Mamba_Python_Extension
DESTINATION ${MAMBA_INSTALL_PYTHON_EXT_LIBDIR}
Expand Down
2 changes: 1 addition & 1 deletion libmambapy/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def libmambapy_version():

skbuild.setup(
version=libmambapy_version(),
packages=["libmambapy", "libmambapy.core"],
packages=["libmambapy", "libmambapy.bindings"],
package_dir={"": "src"},
package_data={"libmambapy": ["py.typed", "__init__.pyi"]},
cmake_languages=["CXX"],
Expand Down
2 changes: 1 addition & 1 deletion libmambapy/src/libmambapy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import libmambapy.version
from libmambapy.core.bindings import * # Legacy which used to combine everything
from libmambapy.bindings.legacy import * # Legacy which used to combine everything

# Define top-level attributes
__version__ = libmambapy.version.__version__
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
//
// The full license is in the file LICENSE, distributed with this software.

#include "core.hpp"
#include "bindings.hpp"

PYBIND11_MODULE(core, m)
PYBIND11_MODULE(bindings, m)
{
mambapy::bindings::bind_submodule(m.def_submodule("bindings"));
mambapy::legacy::bind_submodule(m.def_submodule("legacy"));
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace mambapy
{
namespace bindings
namespace legacy
{
void bind_submodule(pybind11::module_ m);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "mamba/specs/version.hpp"
#include "mamba/util/string.hpp"

#include "core.hpp"
#include "bindings.hpp"
#include "flat_set_caster.hpp"

namespace py = pybind11;
Expand Down Expand Up @@ -1332,7 +1332,7 @@ bind_submodule_impl(pybind11::module_ m)
m.attr("MAMBA_CLEAN_LOCKS") = MAMBA_CLEAN_LOCKS;
}

namespace mambapy::bindings
namespace mambapy::legacy
{
void bind_submodule(pybind11::module_ m)
{
Expand Down

0 comments on commit c49d3eb

Please sign in to comment.