Mentions légales du service

Skip to content
Snippets Groups Projects
Commit e8a4b65a authored by ali's avatar ali
Browse files

rename package name

parent 74d6ab12
No related branches found
No related tags found
No related merge requests found
......@@ -23,4 +23,4 @@ target_link_libraries(_core PRIVATE pybind11::headers)
target_compile_definitions(_core PRIVATE VERSION_INFO=${PROJECT_VERSION})
# The install directory is the output (wheel) directory
install(TARGETS _core DESTINATION scikit_build_example)
install(TARGETS _core DESTINATION pybind_example)
......@@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
[project]
name = "scikit_build_example"
name = "pybind_example"
version = "0.0.1"
description="A minimal example package (with pybind11)"
readme = "README.md"
......
#include <pybind11/pybind11.h>
// #define VERSION_INFO 1.0
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......@@ -7,6 +9,10 @@ int add(int i, int j) {
return i + j;
}
double multiply(double i, double j) {
return i * j;
}
namespace py = pybind11;
PYBIND11_MODULE(_core, m) {
......@@ -14,7 +20,7 @@ PYBIND11_MODULE(_core, m) {
Pybind11 example plugin
-----------------------
.. currentmodule:: scikit_build_example
.. currentmodule:: pybind_example
.. autosummary::
:toctree: _generate
......@@ -27,13 +33,18 @@ PYBIND11_MODULE(_core, m) {
Add two numbers
Some other explanation about the add function.
)pbdoc");
)pbdoc", py::arg("i"), py::arg("j"));
m.def("multiply", &multiply, R"pbdoc(
Multiply two numbers
Some other explanation about the multiply function.
)pbdoc",py::arg("i"), py::arg("j"));
m.def("subtract", [](int i, int j) { return i - j; }, R"pbdoc(
Subtract two numbers
Some other explanation about the subtract function.
)pbdoc");
)pbdoc",py::arg("i"), py::arg("j"));
#ifdef VERSION_INFO
m.attr("__version__") = MACRO_STRINGIFY(VERSION_INFO);
......
from __future__ import annotations
from ._core import __doc__, __version__, add, subtract
from ._core import __doc__, __version__, add, subtract, multiply
__all__ = ["__doc__", "__version__", "add", "subtract"]
from __future__ import annotations
import scikit_build_example as m
import pybind_example as m
def test_version():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment