Skip to content

Commit

Permalink
update pybind11
Browse files Browse the repository at this point in the history
  • Loading branch information
thelsing committed Sep 14, 2024
1 parent 1f406ab commit e15da84
Show file tree
Hide file tree
Showing 126 changed files with 15,800 additions and 24,193 deletions.
2 changes: 2 additions & 0 deletions examples/knxPython/pybind11/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ Checks: |
readability-string-compare,
readability-suspicious-call-argument,
readability-uniqueptr-delete-release,
-bugprone-chained-comparison,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
-bugprone-reserved-identifier,
-bugprone-unused-raii,
-performance-enum-size,
CheckOptions:
- key: modernize-use-equals-default.IgnoreMacros
Expand Down
10 changes: 9 additions & 1 deletion examples/knxPython/pybind11/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }} (deadsnakes)
uses: deadsnakes/action@v3.1.0
uses: deadsnakes/action@v3.2.0
with:
python-version: ${{ matrix.python-version }}
debug: ${{ matrix.python-debug }}
Expand Down Expand Up @@ -340,6 +340,12 @@ jobs:
- clang: 16
std: 20
container_suffix: "-bullseye"
- clang: 17
std: 20
container_suffix: "-bookworm"
- clang: 18
std: 20
container_suffix: "-bookworm"

name: "🐍 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64"
container: "silkeh/clang:${{ matrix.clang }}${{ matrix.container_suffix }}"
Expand Down Expand Up @@ -501,7 +507,9 @@ jobs:
- { gcc: 7, std: 17 }
- { gcc: 8, std: 14 }
- { gcc: 8, std: 17 }
- { gcc: 9, std: 20 }
- { gcc: 10, std: 17 }
- { gcc: 10, std: 20 }
- { gcc: 11, std: 20 }
- { gcc: 12, std: 20 }
- { gcc: 13, std: 20 }
Expand Down
2 changes: 1 addition & 1 deletion examples/knxPython/pybind11/.github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
# in .github/CONTRIBUTING.md and update as needed.
name: Clang-Tidy
runs-on: ubuntu-latest
container: silkeh/clang:15-bullseye
container: silkeh/clang:18-bookworm
steps:
- uses: actions/checkout@v4

Expand Down
9 changes: 6 additions & 3 deletions examples/knxPython/pybind11/.github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,30 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
needs: [packaging]
environment: pypi
environment:
name: pypi
url: https://pypi.org/p/pybind11
permissions:
id-token: write
attestations: write
contents: read

steps:
# Downloads all to directories matching the artifact names
- uses: actions/download-artifact@v4

- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2
uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
with:
subject-path: "*/pybind11*"

- name: Publish standard package
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: standard/
attestations: true

- name: Publish global package
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: global/
attestations: true
14 changes: 7 additions & 7 deletions examples/knxPython/pybind11/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ repos:

# Clang format the codebase automatically
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v18.1.5"
rev: "v18.1.8"
hooks:
- id: clang-format
types_or: [c++, c, cuda]

# Ruff, the Python auto-correcting linter/formatter written in Rust
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
rev: v0.6.3
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format

# Check static types with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.10.0"
rev: "v1.11.2"
hooks:
- id: mypy
args: []
Expand Down Expand Up @@ -79,7 +79,7 @@ repos:

# Also code format the docs
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
rev: "1.18.0"
hooks:
- id: blacken-docs
additional_dependencies:
Expand All @@ -93,7 +93,7 @@ repos:

# Avoid directional quotes
- repo: https://github.com/sirosen/texthooks
rev: "0.6.6"
rev: "0.6.7"
hooks:
- id: fix-ligatures
- id: fix-smartquotes
Expand Down Expand Up @@ -142,14 +142,14 @@ repos:

# PyLint has native support - not always usable, but works for us
- repo: https://github.com/PyCQA/pylint
rev: "v3.2.2"
rev: "v3.2.7"
hooks:
- id: pylint
files: ^pybind11

# Check schemas on some of our YAML files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.4
rev: 0.29.2
hooks:
- id: check-readthedocs
- id: check-github-workflows
Expand Down
3 changes: 3 additions & 0 deletions examples/knxPython/pybind11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,14 @@ endif()
set(PYBIND11_HEADERS
include/pybind11/detail/class.h
include/pybind11/detail/common.h
include/pybind11/detail/cpp_conduit.h
include/pybind11/detail/descr.h
include/pybind11/detail/init.h
include/pybind11/detail/internals.h
include/pybind11/detail/type_caster_base.h
include/pybind11/detail/typeid.h
include/pybind11/detail/value_and_holder.h
include/pybind11/detail/exception_translation.h
include/pybind11/attr.h
include/pybind11/buffer_info.h
include/pybind11/cast.h
Expand Down
2 changes: 1 addition & 1 deletion examples/knxPython/pybind11/docs/advanced/cast/eigen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ copying to take place:
"small"_a // <- This one can be copied if needed
);
With the above binding code, attempting to call the the ``some_method(m)``
With the above binding code, attempting to call the ``some_method(m)``
method on a ``MyClass`` object, or attempting to call ``some_function(m, m2)``
will raise a ``RuntimeError`` rather than making a temporary copy of the array.
It will, however, allow the ``m2`` argument to be copied into a temporary if
Expand Down
6 changes: 3 additions & 3 deletions examples/knxPython/pybind11/docs/advanced/cast/stl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ the declaration

.. code-block:: cpp
PYBIND11_MAKE_OPAQUE(std::vector<int>);
PYBIND11_MAKE_OPAQUE(std::vector<int>)
before any binding code (e.g. invocations to ``class_::def()``, etc.). This
macro must be specified at the top level (and outside of any namespaces), since
Expand Down Expand Up @@ -207,8 +207,8 @@ The following example showcases usage of :file:`pybind11/stl_bind.h`:
// Don't forget this
#include <pybind11/stl_bind.h>
PYBIND11_MAKE_OPAQUE(std::vector<int>);
PYBIND11_MAKE_OPAQUE(std::map<std::string, double>);
PYBIND11_MAKE_OPAQUE(std::vector<int>)
PYBIND11_MAKE_OPAQUE(std::map<std::string, double>)
// ...
Expand Down
6 changes: 3 additions & 3 deletions examples/knxPython/pybind11/docs/advanced/smart_ptrs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ top namespace level before any binding code:

.. code-block:: cpp
PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>);
PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>)
The first argument of :func:`PYBIND11_DECLARE_HOLDER_TYPE` should be a
placeholder name that is used as a template parameter of the second argument.
Expand All @@ -136,7 +136,7 @@ by default. Specify

.. code-block:: cpp
PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>, true);
PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>, true)
if ``SmartPtr<T>`` can always be initialized from a ``T*`` pointer without the
risk of inconsistencies (such as multiple independent ``SmartPtr`` instances
Expand All @@ -154,7 +154,7 @@ specialized:
.. code-block:: cpp
// Always needed for custom holder types
PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>);
PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>)
// Only needed if the type's `.get()` goes by another name
namespace PYBIND11_NAMESPACE { namespace detail {
Expand Down
7 changes: 7 additions & 0 deletions examples/knxPython/pybind11/docs/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ For brevity, all code examples assume that the following two lines are present:
namespace py = pybind11;
.. note::

``pybind11/pybind11.h`` includes ``Python.h``, as such it must be the first file
included in any source file or header for `the same reasons as Python.h`_.

.. _`the same reasons as Python.h`: https://docs.python.org/3/extending/extending.html#a-simple-example

Some features may require additional headers, but those will be specified as needed.

.. _simple_example:
Expand Down
Loading

0 comments on commit e15da84

Please sign in to comment.