Skip to content
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

Fix for embedded Python interpreter issues on macOS #755

Merged
merged 2 commits into from
Mar 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion extern/pybind11
Submodule pybind11 updated 78 files
+19 −3 .github/ISSUE_TEMPLATE/bug-report.yml
+153 −13 .github/workflows/ci.yml
+6 −2 .github/workflows/configure.yml
+2 −0 .github/workflows/format.yml
+5 −1 .github/workflows/labeler.yml
+4 −4 .github/workflows/pip.yml
+2 −0 .github/workflows/upstream.yml
+1 −0 .gitignore
+17 −17 .pre-commit-config.yaml
+2 −0 CMakeLists.txt
+1 −0 MANIFEST.in
+6 −3 docs/advanced/exceptions.rst
+37 −0 docs/advanced/misc.rst
+123 −1 docs/changelog.rst
+0 −1 docs/conf.py
+1 −1 include/pybind11/attr.h
+9 −5 include/pybind11/cast.h
+9 −1 include/pybind11/detail/class.h
+82 −34 include/pybind11/detail/common.h
+21 −15 include/pybind11/detail/init.h
+31 −3 include/pybind11/detail/internals.h
+9 −0 include/pybind11/detail/type_caster_base.h
+1 −702 include/pybind11/eigen.h
+701 −0 include/pybind11/eigen/matrix.h
+511 −0 include/pybind11/eigen/tensor.h
+80 −42 include/pybind11/embed.h
+9 −2 include/pybind11/functional.h
+4 −4 include/pybind11/gil.h
+13 −12 include/pybind11/numpy.h
+16 −0 include/pybind11/options.h
+81 −57 include/pybind11/pybind11.h
+42 −22 include/pybind11/pytypes.h
+107 −47 include/pybind11/stl_bind.h
+7 −1 pybind11/__main__.py
+1 −1 pybind11/_version.py
+3 −4 pybind11/setup_helpers.py
+2 −2 setup.cfg
+29 −4 tests/CMakeLists.txt
+25 −1 tests/conftest.py
+14 −0 tests/eigen_tensor_avoid_stl_array.cpp
+7 −3 tests/extra_python_package/test_files.py
+7 −2 tests/test_builtin_casters.cpp
+37 −0 tests/test_callbacks.cpp
+13 −0 tests/test_callbacks.py
+0 −4 tests/test_chrono.py
+3 −3 tests/test_class.cpp
+10 −2 tests/test_class.py
+13 −21 tests/test_constants_and_functions.cpp
+2 −1 tests/test_custom_type_casters.py
+53 −0 tests/test_docstring_options.cpp
+23 −0 tests/test_docstring_options.py
+3 −5 tests/test_eigen_matrix.cpp
+1 −1 tests/test_eigen_matrix.py
+18 −0 tests/test_eigen_tensor.cpp
+333 −0 tests/test_eigen_tensor.inl
+290 −0 tests/test_eigen_tensor.py
+1 −3 tests/test_embed/catch.cpp
+70 −3 tests/test_embed/test_interpreter.cpp
+3 −2 tests/test_exceptions.py
+2 −2 tests/test_gil_scoped.py
+4 −5 tests/test_kwargs_and_defaults.cpp
+2 −1 tests/test_local_bindings.py
+4 −5 tests/test_modules.py
+2 −0 tests/test_numpy_array.cpp
+6 −0 tests/test_numpy_array.py
+8 −15 tests/test_operator_overloading.cpp
+0 −1 tests/test_operator_overloading.py
+2 −0 tests/test_pytypes.cpp
+6 −0 tests/test_pytypes.py
+26 −0 tests/test_stl_binders.py
+2 −1 tests/test_virtual_functions.cpp
+4 −2 tools/FindPythonLibsNew.cmake
+4 −5 tools/make_changelog.py
+10 −0 tools/pybind11Common.cmake
+2 −2 tools/pybind11NewTools.cmake
+1 −1 tools/pybind11Tools.cmake
+3 −1 tools/setup_global.py.in
+2 −0 tools/setup_main.py.in
4 changes: 4 additions & 0 deletions include/utilities/python/InterpreterUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ namespace utils {
py::object requestedDirPath = Path(directoryPath);
if (py::bool_(requestedDirPath.attr("is_dir")())) {
if (std::find(sys_path_vector.begin(), sys_path_vector.end(), directoryPath) == sys_path_vector.end()) {
#ifdef __APPLE__
sys_path.attr("insert")(1, py::str(directoryPath));
#else
sys_path.attr("insert")(sys_path_vector.size(), py::str(directoryPath));
#endif
}
}
else {
Expand Down
Loading