You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by jm...@apache.org on 2021/08/30 18:02:02 UTC

[datasketches-cpp] 01/02: turn pybind11 into python build dependency, removing from source tree. docs no yet updated.

This is an automated email from the ASF dual-hosted git repository.

jmalkin pushed a commit to branch pybind_build_dependency
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git

commit 847babec95c6bfee6774e23ab7d4c736e925ad2c
Author: Jon Malkin <jm...@users.noreply.github.com>
AuthorDate: Mon Aug 30 11:00:30 2021 -0700

    turn pybind11 into python build dependency, removing from source tree.  docs no yet updated.
---
 .gitmodules           | 3 ---
 pyproject.toml        | 4 +++-
 python/CMakeLists.txt | 7 +++++--
 python/pybind11       | 1 -
 setup.py              | 3 ++-
 5 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/.gitmodules b/.gitmodules
index 4dbf077..e69de29 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +0,0 @@
-[submodule "python/pybind11"]
-	path = python/pybind11
-	url = https://github.com/pybind/pybind11
diff --git a/pyproject.toml b/pyproject.toml
index 077b885..a989be3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -2,7 +2,8 @@
 requires = ["wheel",
             "setuptools >= 30.3.0",
             "setuptools_scm",
-            "cmake >= 3.12"]
+            "cmake >= 3.12",
+            "pybind11[global] >= 2.6.0"]
 
 [tool.tox]
 legacy_tox_ini = """
@@ -12,6 +13,7 @@ envlist = py3
 [testenv]
 deps = pytest
        numpy
+       pybind11[global] >= 2.6.0
 changedir = python/tests
 commands = pytest
 """
\ No newline at end of file
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 0b76799..4da7b9d 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -22,9 +22,12 @@ else()
   set(PYBIND11_CPP_STANDARD -std=c++11)
 endif()
 
-add_subdirectory(pybind11)
+find_package(Python3 COMPONENTS Interpreter Development)
+find_package(pybind11 CONFIG)
+#add_subdirectory(pybind11)
 
-pybind11_add_module(python MODULE EXCLUDE_FROM_ALL SYSTEM THIN_LTO)
+#pybind11_add_module(python MODULE EXCLUDE_FROM_ALL SYSTEM THIN_LTO)
+pybind11_add_module(python MODULE EXCLUDE_FROM_ALL THIN_LTO)
 
 target_link_libraries(python
   PRIVATE
diff --git a/python/pybind11 b/python/pybind11
deleted file mode 160000
index 59a2ac2..0000000
--- a/python/pybind11
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 59a2ac2745d8a57ac94c6accced73620d59fb844
diff --git a/setup.py b/setup.py
index 9d270d9..a84954e 100644
--- a/setup.py
+++ b/setup.py
@@ -49,8 +49,9 @@ class CMakeBuild(build_ext):
             os.path.dirname(self.get_ext_fullpath(ext.name)))
         cmake_args =  ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir]
         cmake_args += ['-DWITH_PYTHON=True']
+        cmake_args += ['-DCMAKE_CXX_STANDARD=11']
         # ensure we use a consistent python version
-        cmake_args += ['-DPYTHON_EXECUTABLE=' + sys.executable]
+        cmake_args += ['-DPython3_EXECUTABLE=' + sys.executable]
         cfg = 'Debug' if self.debug else 'Release'
         build_args = ['--config', cfg]
 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org