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 pypa/gh-action-pypi-publish from 1.8.1 to 1.8.7 #31

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
fddf3bd
chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.7
dependabot[bot] Jun 27, 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
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
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 @@ -763,7 +766,7 @@ jobs:
uses: jwlawson/[email protected]

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

Expand Down Expand Up @@ -816,7 +819,7 @@ jobs:
uses: jwlawson/[email protected]

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

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.7
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.7
with:
password: ${{ secrets.pypi_password_global }}
packages_dir: global/
packages-dir: global/
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
9 changes: 5 additions & 4 deletions include/pybind11/detail/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

#define PYBIND11_VERSION_MAJOR 2
#define PYBIND11_VERSION_MINOR 10
#define PYBIND11_VERSION_PATCH 2
#define PYBIND11_VERSION_PATCH 4

// Similar to Python's convention: https://docs.python.org/3/c-api/apiabiversion.html
// Additional convention: 0xD = dev
#define PYBIND11_VERSION_HEX 0x020A0200
#define PYBIND11_VERSION_HEX 0x020A0400

// Define some generic pybind11 helper macros for warning management.
//
Expand Down Expand Up @@ -329,7 +329,8 @@ PYBIND11_WARNING_POP
&& defined(_MSC_VER)) /* PyPy Windows: pytest hangs indefinitely at the end of the \
process (see PR #4268) */ \
&& !defined(PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF)
# define PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF
// The following define will be enabled by default in the 2.11 release
// define PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF
#endif

// #define PYBIND11_STR_LEGACY_PERMISSIVE
Expand Down Expand Up @@ -436,7 +437,7 @@ PYBIND11_WARNING_POP

/** \rst
This macro creates the entry point that will be invoked when the Python interpreter
imports an extension module. The module name is given as the fist argument and it
imports an extension module. The module name is given as the first argument and it
should not be in quotes. The second macro argument defines a variable of type
`py::module_` which can be used to initialize the module.

Expand Down
2 changes: 2 additions & 0 deletions include/pybind11/eigen/matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
PYBIND11_WARNING_PUSH
PYBIND11_WARNING_DISABLE_MSVC(5054) // https://github.com/pybind/pybind11/pull/3741
// C5054: operator '&': deprecated between enumerations of different types
#if defined(__MINGW32__)
PYBIND11_WARNING_DISABLE_GCC("-Wmaybe-uninitialized")
#endif

#include <Eigen/Core>
#include <Eigen/SparseCore>
Expand Down
4 changes: 3 additions & 1 deletion include/pybind11/eigen/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ static_assert(__GNUC__ > 5, "Eigen Tensor support in pybind11 requires GCC > 5.0
PYBIND11_WARNING_PUSH
PYBIND11_WARNING_DISABLE_MSVC(4554)
PYBIND11_WARNING_DISABLE_MSVC(4127)
#if defined(__MINGW32__)
PYBIND11_WARNING_DISABLE_GCC("-Wmaybe-uninitialized")
#endif

#include <unsupported/Eigen/CXX11/Tensor>

Expand Down Expand Up @@ -176,7 +178,7 @@ struct type_caster<Type, typename eigen_tensor_helper<Type>::ValidType> {
return false;
}

if (!convert && !temp.dtype().is(dtype::of<typename Type::Scalar>())) {
if (!temp.dtype().is(dtype::of<typename Type::Scalar>())) {
return false;
}
}
Expand Down
Loading