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

chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 #28

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
895fc66
ci: update PGI build (old one no longer signed) (#4260)
Oct 20, 2022
412918d
feat: add entrypoint for cmake modules dir (#4258)
henryiii Oct 20, 2022
a8f2110
docs: update changelog (#4265)
henryiii Oct 20, 2022
251516b
Cleanup casters to release none() to avoid ref counting (#4269)
Skylion007 Oct 21, 2022
eaa5f7b
Revert "feat: add entrypoint for cmake modules dir" (#4270)
henryiii Oct 21, 2022
305c471
fix: Revert pfect args make iterator (#4234)
Skylion007 Oct 21, 2022
ce63bcb
Fix casts to void* (#4275)
EthanSteinberg Oct 22, 2022
0e82c36
fix: add flag for overriding classic Python search values (#4195)
henryiii Oct 23, 2022
1f187d9
Fix char8_t support (#4278)
VemundH Oct 23, 2022
738a6f8
ci: move to final release of 3.11 (#4286)
henryiii Oct 26, 2022
5b395c9
fix: improve bytes to str decoding error handling (#4294)
Skylion007 Oct 29, 2022
15fde1d
Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216)
Chekov2k Oct 30, 2022
3fb36a9
fix: unicode surrogate character in Python exception message. (#4297)
Oct 31, 2022
f2ee641
docs: prepare for 2.10.1 release (#4279)
henryiii Oct 31, 2022
80dc998
chore: bump versions for 2.10.1
henryiii Oct 31, 2022
0376417
Merge branch 'master' into v2.10
henryiii Dec 20, 2022
2de6e39
[v2.10] Revert the addition of the GIL check feature (#4432)
EthanSteinberg Dec 30, 2022
e414c4b
fix: improve the error reporting for inc_ref GIL failures (#4427)
EthanSteinberg Dec 30, 2022
0abe64c
Fix `detail::obj_class_name()` to work correctly for meta classes. (#…
Jan 2, 2023
050de89
ci: remove clang 10 C++20 (it broke recently) (#4438)
Jan 3, 2023
9d6a79c
fix: issuses detected by static analyzer (#4440)
cyyever Jan 3, 2023
d78de29
chore(deps): update pre-commit hooks (#4439)
pre-commit-ci[bot] Jan 3, 2023
0bd8896
chore: prepare for 2.10.3 (#4437)
henryiii Jan 3, 2023
0ed64a0
docs: fixed typo in spelling of first (#4428)
kajananchinniah Dec 28, 2022
f14bb03
Add clang15 C++20 job (#4443)
Jan 13, 2023
4f6183c
Ensure `import pybind11_tests` traceback is shown. (#4455)
Jan 14, 2023
da780a0
Make sure to properly untrack gc objects before freeing them (#4461)
albanD Jan 18, 2023
5ece09a
Resolve new flake8 error (#4462)
Jan 19, 2023
c0e2eeb
Bump isort version to 5.12.0 (#4480)
Feb 1, 2023
993eb2b
chore: update to black 23 (#4482)
henryiii Feb 1, 2023
a491af6
bugfix: delete proper ctors in gil.h (#4490)
Skylion007 Feb 4, 2023
c06f324
chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493)
dependabot[bot] Feb 6, 2023
3ea37d0
chore(deps): update pre-commit hooks (#4495)
pre-commit-ci[bot] Feb 7, 2023
1f4cf8f
Replace "whitelist" with "allowlist" (#4506)
mikeessen Feb 9, 2023
1cae8dc
fix: tests dir has started to show up in packaging (#4510)
henryiii Feb 16, 2023
c773a02
Appease new flake8 B028 error: (#4513)
Feb 17, 2023
9a1eeed
Make warning suppressions MINGW-specific again. (#4515)
Feb 17, 2023
f5cff4f
fix: nicer stack level for warning (#4516)
henryiii Feb 17, 2023
b596235
Inconsistent comments between 2 templates of `unchecked()`. (#4519)
xkszltl Feb 20, 2023
882cb76
add --version option to pybind11-config (#4526)
eli-schwartz Feb 23, 2023
ec3f6e2
chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4…
dependabot[bot] Mar 16, 2023
3f5a7e5
docs: changelog for 2.10.4 (#4532)
henryiii Mar 16, 2023
5b0a6fc
chore: bump version to 3.10.4
henryiii Mar 16, 2023
fc424b0
chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14
dependabot[bot] Apr 21, 2023
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
29 changes: 16 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
run: brew install boost

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14

- name: Cache wheels
if: runner.os == 'macOS'
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
debug: ${{ matrix.python-debug }}

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14

- name: Valgrind cache
if: matrix.valgrind
Expand Down Expand Up @@ -280,11 +280,11 @@ jobs:
- dev
std:
- 11
container_suffix:
- ""
include:
- clang: 5
std: 14
- clang: 10
std: 20
- clang: 10
std: 17
- clang: 11
Expand All @@ -295,9 +295,12 @@ jobs:
std: 20
- clang: 14
std: 20
- clang: 15
std: 20
container_suffix: "-bullseye"

name: "🐍 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64"
container: "silkeh/clang:${{ matrix.clang }}"
container: "silkeh/clang:${{ matrix.clang }}${{ matrix.container_suffix }}"

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -471,7 +474,7 @@ jobs:
run: python3 -m pip install --upgrade pip

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14

- name: Configure
shell: bash
Expand Down Expand Up @@ -760,10 +763,10 @@ jobs:
architecture: x86

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14

- name: Prepare MSVC
uses: ilammy/[email protected].0
uses: ilammy/[email protected].1
with:
arch: x86

Expand Down Expand Up @@ -813,10 +816,10 @@ jobs:
architecture: x86

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14

- name: Prepare MSVC
uses: ilammy/[email protected].0
uses: ilammy/[email protected].1
with:
arch: x86

Expand Down Expand Up @@ -864,7 +867,7 @@ jobs:
python3 -m pip install -r tests/requirements.txt

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14

- name: Configure C++20
run: >
Expand Down Expand Up @@ -997,7 +1000,7 @@ jobs:
python-version: ${{ matrix.python }}

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14

- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3
Expand Down Expand Up @@ -1067,7 +1070,7 @@ jobs:
run: clang++ --version

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14

- name: Run pip installs
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
# An action for adding a specific version of CMake:
# https://github.com/jwlawson/actions-setup-cmake
- name: Setup CMake ${{ matrix.cmake }}
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14
with:
cmake-version: ${{ matrix.cmake }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ jobs:
- uses: actions/download-artifact@v3

- name: Publish standard package
uses: pypa/gh-action-pypi-publish@v1.6.4
uses: pypa/gh-action-pypi-publish@v1.8.1
with:
password: ${{ secrets.pypi_password }}
packages_dir: standard/
packages-dir: standard/

- name: Publish global package
uses: pypa/gh-action-pypi-publish@v1.6.4
uses: pypa/gh-action-pypi-publish@v1.8.1
with:
password: ${{ secrets.pypi_password_global }}
packages_dir: global/
packages-dir: global/
2 changes: 1 addition & 1 deletion .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: sudo apt-get install libboost-dev

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14

- name: Prepare env
run: |
Expand Down
24 changes: 12 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,53 +41,53 @@ repos:

# Upgrade old Python syntax
- repo: https://github.com/asottile/pyupgrade
rev: "v3.3.0"
rev: "v3.3.1"
hooks:
- id: pyupgrade
args: [--py36-plus]

# Nicely sort includes
- repo: https://github.com/PyCQA/isort
rev: "5.10.1"
rev: "5.12.0"
hooks:
- id: isort

# Black, the code formatter, natively supports pre-commit
- repo: https://github.com/psf/black
rev: "22.10.0" # Keep in sync with blacken-docs
rev: "23.1.0" # Keep in sync with blacken-docs
hooks:
- id: black

# Also code format the docs
- repo: https://github.com/asottile/blacken-docs
rev: "v1.12.1"
rev: "1.13.0"
hooks:
- id: blacken-docs
additional_dependencies:
- black==22.10.0 # keep in sync with black hook
- black==23.1.0 # keep in sync with black hook

# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: "v1.3.1"
rev: "v1.4.2"
hooks:
- id: remove-tabs

- repo: https://github.com/sirosen/texthooks
rev: "0.4.0"
rev: "0.5.0"
hooks:
- id: fix-ligatures
- id: fix-smartquotes

# Autoremoves unused imports
- repo: https://github.com/hadialqattan/pycln
rev: "v2.1.2"
rev: "v2.1.3"
hooks:
- id: pycln
stages: [manual]

# Checking for common mistakes
- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.9.0"
rev: "v1.10.0"
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
Expand Down Expand Up @@ -116,7 +116,7 @@ repos:

# PyLint has native support - not always usable, but works for us
- repo: https://github.com/PyCQA/pylint
rev: "v2.15.8"
rev: "v2.16.1"
hooks:
- id: pylint
files: ^pybind11
Expand Down Expand Up @@ -160,7 +160,7 @@ repos:

# Check for common shell mistakes
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.8.0.4"
rev: "v0.9.0.2"
hooks:
- id: shellcheck

Expand All @@ -175,7 +175,7 @@ repos:

# Clang format the codebase automatically
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v15.0.4"
rev: "v15.0.7"
hooks:
- id: clang-format
types_or: [c++, c, cuda]
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
prune tests
recursive-include pybind11/include/pybind11 *.h
recursive-include pybind11 *.py
recursive-include pybind11 py.typed
Expand Down
28 changes: 28 additions & 0 deletions docs/advanced/misc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,34 @@ The ``call_go`` wrapper can also be simplified using the ``call_guard`` policy
m.def("call_go", &call_go, py::call_guard<py::gil_scoped_release>());


Common Sources Of Global Interpreter Lock Errors
==================================================================

Failing to properly hold the Global Interpreter Lock (GIL) is one of the
more common sources of bugs within code that uses pybind11. If you are
running into GIL related errors, we highly recommend you consult the
following checklist.

- Do you have any global variables that are pybind11 objects or invoke
pybind11 functions in either their constructor or destructor? You are generally
not allowed to invoke any Python function in a global static context. We recommend
using lazy initialization and then intentionally leaking at the end of the program.

- Do you have any pybind11 objects that are members of other C++ structures? One
commonly overlooked requirement is that pybind11 objects have to increase their reference count
whenever their copy constructor is called. Thus, you need to be holding the GIL to invoke
the copy constructor of any C++ class that has a pybind11 member. This can sometimes be very
tricky to track for complicated programs Think carefully when you make a pybind11 object
a member in another struct.

- C++ destructors that invoke Python functions can be particularly troublesome as
destructors can sometimes get invoked in weird and unexpected circumstances as a result
of exceptions.

- You should try running your code in a debug build. That will enable additional assertions
within pybind11 that will throw exceptions on certain GIL handling errors
(reference counting operations).

Binding sequence data types, iterators, the slicing protocol, etc.
==================================================================

Expand Down
71 changes: 70 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,75 @@ IN DEVELOPMENT

Changes will be summarized here periodically.

Changes:

* ``PyGILState_Check()``'s in ``pybind11::handle``'s ``inc_ref()`` &
``dec_ref()`` are now enabled by default again.
`#4246 <https://github.com/pybind/pybind11/pull/4246>`_

* ``py::initialize_interpreter()`` using ``PyConfig_InitPythonConfig()``
instead of ``PyConfig_InitIsolatedConfig()``, to obtain complete
``sys.path``.
`#4473 <https://github.com/pybind/pybind11/pull/4473>`_

* Cast errors now always include Python type information, even if
``PYBIND11_DETAILED_ERROR_MESSAGES`` is not defined. This increases binary
sizes slightly (~1.5%) but the error messages are much more informative.
`#4463 <https://github.com/pybind/pybind11/pull/4463>`_


Build system improvements:

* Update clang-tidy to 15 in CI.
`#4387 <https://github.com/pybind/pybind11/pull/4387>`_

* Moved the linting framework over to Ruff.
`#4483 <https://github.com/pybind/pybind11/pull/4483>`_

Version 2.10.4 (Mar 16, 2023)
----------------------------

Changes:

* ``python3 -m pybind11`` gained a ``--version`` option (prints the version and
exits).
`#4526 <https://github.com/pybind/pybind11/pull/4526>`_

Bug Fixes:

* Fix a warning when pydebug is enabled on Python 3.11.
`#4461 <https://github.com/pybind/pybind11/pull/4461>`_

* Ensure ``gil_scoped_release`` RAII is non-copyable.
`#4490 <https://github.com/pybind/pybind11/pull/4490>`_

* Ensure the tests dir does not show up with new versions of setuptools.
`#4510 <https://github.com/pybind/pybind11/pull/4510>`_

* Better stacklevel for a warning in setuptools helpers.
`#4516 <https://github.com/pybind/pybind11/pull/4516>`_

Version 2.10.3 (Jan 3, 2023)
----------------------------

Changes:

* Temporarily made our GIL status assertions (added in 2.10.2) disabled by
default (re-enable manually by defining
``PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF``, will be enabled in 2.11).
`#4432 <https://github.com/pybind/pybind11/pull/4432>`_

* Improved error messages when ``inc_ref``/``dec_ref`` are called with an
invalid GIL state.
`#4427 <https://github.com/pybind/pybind11/pull/4427>`_
`#4436 <https://github.com/pybind/pybind11/pull/4436>`_

Bug Fixes:

* Some minor touchups found by static analyzers.
`#4440 <https://github.com/pybind/pybind11/pull/4440>`_


Version 2.10.2 (Dec 20, 2022)
-----------------------------

Expand All @@ -30,7 +99,7 @@ Changes:
* ``PyGILState_Check()``'s were integrated to ``pybind11::handle``
``inc_ref()`` & ``dec_ref()``. The added GIL checks are guarded by
``PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF``, which is the default only if
``NDEBUG`` is not defined.
``NDEBUG`` is not defined. (Made non-default in 2.10.3, will be active in 2.11)
`#4246 <https://github.com/pybind/pybind11/pull/4246>`_

* Add option for enable/disable enum members in docstring.
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ def clean_up(app, exception):


def setup(app):

# Add hook for building doxygen xml when needed
app.connect("builder-inited", generate_doxygen_xml)

Expand Down
2 changes: 1 addition & 1 deletion include/pybind11/attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ struct process_attribute<doc> : process_attribute_default<doc> {
template <>
struct process_attribute<const char *> : process_attribute_default<const char *> {
static void init(const char *d, function_record *r) { r->doc = const_cast<char *>(d); }
static void init(const char *d, type_record *r) { r->doc = const_cast<char *>(d); }
static void init(const char *d, type_record *r) { r->doc = d; }
};
template <>
struct process_attribute<char *> : process_attribute<const char *> {};
Expand Down
10 changes: 9 additions & 1 deletion include/pybind11/detail/class.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,17 @@ inline void clear_instance(PyObject *self) {
/// Instance destructor function for all pybind11 types. It calls `type_info.dealloc`
/// to destroy the C++ object itself, while the rest is Python bookkeeping.
extern "C" inline void pybind11_object_dealloc(PyObject *self) {
auto *type = Py_TYPE(self);

// If this is a GC tracked object, untrack it first
// Note that the track call is implicitly done by the
// default tp_alloc, which we never override.
if (PyType_HasFeature(type, Py_TPFLAGS_HAVE_GC) != 0) {
PyObject_GC_UnTrack(self);
}

clear_instance(self);

auto *type = Py_TYPE(self);
type->tp_free(self);

#if PY_VERSION_HEX < 0x03080000
Expand Down
Loading