diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28a94e299..1a56e0a6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -621,6 +621,7 @@ jobs: if: matrix.centos == 8 run: echo Release > VAR_BUILD_TYPE + # Temporally disabling EIGEN due to SSL issue in CentOS 7 - name: Configure shell: bash run: > diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d9be8c5e8..db39c7215 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: exclude: ^noxfile.py$ - repo: https://github.com/asottile/pyupgrade - rev: v2.28.0 + rev: v2.29.0 hooks: - id: pyupgrade diff --git a/docs/changelog.rst b/docs/changelog.rst index 04e2714fc..1dab8765f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -6,8 +6,14 @@ Changelog Starting with version 1.8.0, pybind11 releases use a `semantic versioning `_ policy. -v2.8.0 (WIP) ------------- + +IN DEVELOPMENT +-------------- + + + +v2.8.0 (Oct 4, 2021) +-------------------- New features: @@ -46,13 +52,17 @@ New features: references instead of copies. `#3293 `_ +* Improve the classes generated by ``bind_map``: `#3310 `_ + * Change ``.items`` from an iterator to a dictionary view. + * Add ``.keys`` and ``.values`` (both dictionary views). + * Allow ``__contains__`` to take any object. + * ``pybind11::custom_type_setup`` was added, for customizing the ``PyHeapTypeObject`` corresponding to a class, which may be useful for enabling garbage collection support, among other things. `#3287 `_ - Changes: * Set ``__file__`` constant when running ``eval_file`` in an embedded interpreter. @@ -106,6 +116,9 @@ Build system improvements: * Fix a harmless warning from CMake 3.21 with the classic Python discovery. `#3220 `_ +* Eigen repo and version can now be specified as cmake options. + `#3324 `_ + Backend and tidying up: diff --git a/docs/release.rst b/docs/release.rst index e4f3d1902..7fa254eaf 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -27,6 +27,7 @@ To release a new version of pybind11: ``include/pybind11/detail/common.h``. PATCH should be a simple integer. - Update the version HEX just below, as well. - Update ``pybind11/_version.py`` (match above) + - Run ``nox -s tests_packaging``` to ensure this was done correctly. - Ensure that all the information in ``setup.cfg`` is up-to-date, like supported Python versions. - Add release date in ``docs/changelog.rst``. @@ -64,6 +65,7 @@ To release a new version of pybind11: - Update version macros in ``include/pybind11/detail/common.h`` (set PATCH to ``0.dev1`` and increment MINOR). - Update ``_version.py`` to match + - Run ``nox -s tests_packaging``` to ensure this was done correctly. - Add a spot for in-development updates in ``docs/changelog.rst``. - ``git add``, ``git commit``, ``git push`` diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 3bd84da57..9ad305a4e 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -10,12 +10,12 @@ #pragma once #define PYBIND11_VERSION_MAJOR 2 -#define PYBIND11_VERSION_MINOR 8 -#define PYBIND11_VERSION_PATCH 0.dev2 +#define PYBIND11_VERSION_MINOR 9 +#define PYBIND11_VERSION_PATCH 0.dev1 // Similar to Python's convention: https://docs.python.org/3/c-api/apiabiversion.html // Additional convention: 0xD = dev -#define PYBIND11_VERSION_HEX 0x020800D2 +#define PYBIND11_VERSION_HEX 0x020900D1 #define PYBIND11_NAMESPACE_BEGIN(name) namespace name { #define PYBIND11_NAMESPACE_END(name) } diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index f60ea41c9..ff053d563 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -18,6 +18,7 @@ #include "detail/init.h" #include "detail/smart_holder_sfinae_hooks_only.h" +#include #include #include #include @@ -1624,7 +1625,7 @@ public: char *doc_prev = rec_fget->doc; /* 'extra' field may include a property-specific documentation string */ detail::process_attributes::init(extra..., rec_fget); if (rec_fget->doc && rec_fget->doc != doc_prev) { - free(doc_prev); + std::free(doc_prev); rec_fget->doc = PYBIND11_COMPAT_STRDUP(rec_fget->doc); } } @@ -1632,7 +1633,7 @@ public: char *doc_prev = rec_fset->doc; detail::process_attributes::init(extra..., rec_fset); if (rec_fset->doc && rec_fset->doc != doc_prev) { - free(doc_prev); + std::free(doc_prev); rec_fset->doc = PYBIND11_COMPAT_STRDUP(rec_fset->doc); } if (! rec_active) rec_active = rec_fset; diff --git a/pybind11/_version.py b/pybind11/_version.py index d212f1dfb..ce894a774 100644 --- a/pybind11/_version.py +++ b/pybind11/_version.py @@ -8,5 +8,5 @@ def _to_int(s): return s -__version__ = "2.8.0.dev2" +__version__ = "2.9.0.dev1" version_info = tuple(_to_int(s) for s in __version__.split(".")) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d960f7184..f4145d35c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -189,6 +189,14 @@ set(PYBIND11_CROSS_MODULE_GIL_TESTS test_gil_scoped.py) set(PYBIND11_CLASS_SH_MODULE_LOCAL_TESTS test_class_sh_module_local.py) +set(PYBIND11_EIGEN_REPO + "https://gitlab.com/libeigen/eigen.git" + CACHE STRING "Eigen repository to use for tests") +# This hash is for 3.3.8, using a hash for security reasons +set(PYBIND11_EIGEN_VERSION + "dc252fbf00079ccab57948a164b1421703fe4361" + CACHE STRING "Eigen version to use for tests") + # Check if Eigen is available; if not, remove from PYBIND11_TEST_FILES (but # keep it in PYBIND11_PYTEST_FILES, so that we get the "eigen is not installed" # skip message). @@ -202,13 +210,11 @@ if(PYBIND11_TEST_FILES_EIGEN_I GREATER -1) message(FATAL_ERROR "CMake 3.11+ required when using DOWNLOAD_EIGEN") endif() - set(EIGEN3_VERSION_STRING "3.3.8") - include(FetchContent) FetchContent_Declare( eigen - GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git - GIT_TAG ${EIGEN3_VERSION_STRING}) + GIT_REPOSITORY "${PYBIND11_EIGEN_REPO}" + GIT_TAG "${PYBIND11_EIGEN_VERSION}") FetchContent_GetProperties(eigen) if(NOT eigen_POPULATED) diff --git a/tests/test_embed/test_interpreter.cpp b/tests/test_embed/test_interpreter.cpp index fae14f751..20bcade0a 100644 --- a/tests/test_embed/test_interpreter.cpp +++ b/tests/test_embed/test_interpreter.cpp @@ -8,6 +8,7 @@ #include +#include #include #include #include @@ -315,7 +316,7 @@ TEST_CASE("sys.argv gets initialized properly") { { char *argv[] = {strdup("a.out")}; py::scoped_interpreter argv_scope(true, 1, argv); - free(argv[0]); + std::free(argv[0]); auto module = py::module::import("test_interpreter"); auto py_widget = module.attr("DerivedWidget")("The question"); const auto &cpp_widget = py_widget.cast();