mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 21:25:13 +00:00
Merge branch 'master' into smart_holder
This commit is contained in:
commit
5a90dae7fe
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -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: >
|
||||
|
@ -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
|
||||
|
||||
|
@ -6,8 +6,14 @@ Changelog
|
||||
Starting with version 1.8.0, pybind11 releases use a `semantic versioning
|
||||
<http://semver.org>`_ 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 <https://github.com/pybind/pybind11/pull/3293>`_
|
||||
|
||||
* Improve the classes generated by ``bind_map``: `#3310 <https://github.com/pybind/pybind11/pull/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 <https://github.com/pybind/pybind11/pull/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 <https://github.com/pybind/pybind11/pull/3220>`_
|
||||
|
||||
* Eigen repo and version can now be specified as cmake options.
|
||||
`#3324 <https://github.com/pybind/pybind11/pull/3324>`_
|
||||
|
||||
|
||||
Backend and tidying up:
|
||||
|
||||
|
@ -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``
|
||||
|
||||
|
@ -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) }
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "detail/init.h"
|
||||
#include "detail/smart_holder_sfinae_hooks_only.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
#include <new>
|
||||
#include <vector>
|
||||
@ -1624,7 +1625,7 @@ public:
|
||||
char *doc_prev = rec_fget->doc; /* 'extra' field may include a property-specific documentation string */
|
||||
detail::process_attributes<Extra...>::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<Extra...>::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;
|
||||
|
@ -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("."))
|
||||
|
@ -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)
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <catch.hpp>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
#include <functional>
|
||||
#include <thread>
|
||||
@ -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<const Widget &>();
|
||||
|
Loading…
Reference in New Issue
Block a user