Skip to content

Commit

Permalink
Merge branch 'master' into numpy.typing-and-empty-tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Jan 25, 2025
2 parents 6e5df0f + 741d86f commit 72b387c
Show file tree
Hide file tree
Showing 157 changed files with 5,027 additions and 1,095 deletions.
2 changes: 2 additions & 0 deletions .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: 5 additions & 5 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ nox -s build
### Full setup

To setup an ideal development environment, run the following commands on a
system with CMake 3.14+:
system with CMake 3.15+:

```bash
python3 -m venv venv
Expand All @@ -96,8 +96,8 @@ Tips:
* You can use `virtualenv` (faster, from PyPI) instead of `venv`.
* You can select any name for your environment folder; if it contains "env" it
will be ignored by git.
* If you don't have CMake 3.14+, just add "cmake" to the pip install command.
* You can use `-DPYBIND11_FINDPYTHON=ON` to use FindPython on CMake 3.12+
* If you don't have CMake 3.15+, just add "cmake" to the pip install command.
* You can use `-DPYBIND11_FINDPYTHON=ON` to use FindPython.
* In classic mode, you may need to set `-DPYTHON_EXECUTABLE=/path/to/python`.
FindPython uses `-DPython_ROOT_DIR=/path/to` or
`-DPython_EXECUTABLE=/path/to/python`.
Expand Down Expand Up @@ -149,8 +149,8 @@ To run the tests, you can "build" the check target:
cmake --build build --target check
```

`--target` can be spelled `-t` in CMake 3.15+. You can also run individual
tests with these targets:
`--target` can be spelled `-t`. You can also run individual tests with these
targets:

* `pytest`: Python tests only, using the
[pytest](https://docs.pytest.org/en/stable/) framework
Expand Down
59 changes: 36 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
- 'pypy-3.8'
- 'pypy-3.9'
- 'pypy-3.10'
- 'graalpy-24.1'

# Items in here will either be added to the build matrix (if not
# present), or add new keys to an existing matrix element if all the
Expand All @@ -64,9 +65,31 @@ jobs:
# Inject a couple Windows 2019 runs
- runs-on: windows-2019
python: '3.9'
# Inject a few runs with different runtime libraries
- runs-on: windows-2022
python: '3.9'
args: >
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
- runs-on: windows-2022
python: '3.10'
args: >
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
# This needs a python built with MTd
# - runs-on: windows-2022
# python: '3.11'
# args: >
# -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug
- runs-on: windows-2022
python: '3.12'
args: >
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL
# Extra ubuntu latest job
- runs-on: ubuntu-latest
python: '3.11'
exclude:
# The setup-python action currently doesn't have graalpy for windows
- python: 'graalpy-24.1'
runs-on: 'windows-2022'


name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
Expand Down Expand Up @@ -122,6 +145,7 @@ jobs:
-DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
-DPYBIND11_NUMPY_1_ONLY=ON
-DPYBIND11_PYTEST_ARGS=-v
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=11
Expand Down Expand Up @@ -151,6 +175,7 @@ jobs:
-DPYBIND11_WERROR=ON
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
-DPYBIND11_NUMPY_1_ONLY=ON
-DPYBIND11_PYTEST_ARGS=-v
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=17
Expand All @@ -170,6 +195,7 @@ jobs:
run: >
cmake -S . -B build3
-DPYBIND11_WERROR=ON
-DPYBIND11_PYTEST_ARGS=-v
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=17
Expand Down Expand Up @@ -243,7 +269,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 @@ -310,22 +336,11 @@ jobs:
strategy:
fail-fast: false
matrix:
clang:
- 3.6
- 3.7
- 3.9
- 7
- 9
- dev
std:
- 11
container_suffix:
- ""
include:
- clang: 5
std: 14
- clang: 10
std: 17
- clang: 11
std: 20
- clang: 12
Expand All @@ -340,6 +355,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 @@ -497,10 +518,6 @@ jobs:
fail-fast: false
matrix:
include:
- { gcc: 7, std: 11 }
- { gcc: 7, std: 17 }
- { gcc: 8, std: 14 }
- { gcc: 8, std: 17 }
- { gcc: 9, std: 20 }
- { gcc: 10, std: 17 }
- { gcc: 10, std: 20 }
Expand Down Expand Up @@ -721,9 +738,9 @@ jobs:

# This tests an "install" with the CMake tools
install-classic:
name: "🐍 3.7 • Debian • x86 • Install"
name: "🐍 3.9 • Debian • x86 • Install"
runs-on: ubuntu-latest
container: i386/debian:buster
container: i386/debian:bullseye

steps:
- uses: actions/checkout@v1 # v1 is required to run inside docker
Expand Down Expand Up @@ -803,7 +820,6 @@ jobs:
fail-fast: false
matrix:
python:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
Expand All @@ -821,8 +837,6 @@ jobs:
args: -DCMAKE_CXX_STANDARD=20
- python: '3.8'
args: -DCMAKE_CXX_STANDARD=17
- python: '3.7'
args: -DCMAKE_CXX_STANDARD=14


name: "🐍 ${{ matrix.python }} • MSVC 2019 • x86 ${{ matrix.args }}"
Expand Down Expand Up @@ -1001,7 +1015,6 @@ jobs:
git
mingw-w64-${{matrix.env}}-gcc
mingw-w64-${{matrix.env}}-python-pip
mingw-w64-${{matrix.env}}-python-numpy
mingw-w64-${{matrix.env}}-cmake
mingw-w64-${{matrix.env}}-make
mingw-w64-${{matrix.env}}-python-pytest
Expand All @@ -1013,7 +1026,7 @@ jobs:
with:
msystem: ${{matrix.sys}}
install: >-
git
mingw-w64-${{matrix.env}}-python-numpy
mingw-w64-${{matrix.env}}-python-scipy
mingw-w64-${{matrix.env}}-eigen3
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,30 @@ jobs:
include:
- runs-on: ubuntu-20.04
arch: x64
cmake: "3.5"
cmake: "3.15"

- runs-on: ubuntu-20.04
arch: x64
cmake: "3.29"

- runs-on: macos-13
arch: x64
cmake: "3.7"
cmake: "3.15"

- runs-on: windows-2019
arch: x64 # x86 compilers seem to be missing on 2019 image
cmake: "3.18"

name: 🐍 3.7 • CMake ${{ matrix.cmake }} • ${{ matrix.runs-on }}
name: 🐍 3.8 • CMake ${{ matrix.cmake }} • ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v4

- name: Setup Python 3.7
- name: Setup Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.8
architecture: ${{ matrix.arch }}

- name: Prepare env
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/emscripten.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: WASM

on:
workflow_dispatch:
pull_request:
branches:
- master
- stable
- v*

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-wasm-emscripten:
name: Pyodide wheel
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- uses: pypa/[email protected]
env:
PYODIDE_BUILD_EXPORTS: whole_archive
with:
package-dir: tests
only: cp312-pyodide_wasm32
2 changes: 1 addition & 1 deletion .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 .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@c4fbc648846ca6f503a13a2281a5e7b98aa57202 # v2.0.1
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
18 changes: 9 additions & 9 deletions .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: "v19.1.4"
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.8.1
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.13.0"
hooks:
- id: mypy
args: []
Expand All @@ -62,7 +62,7 @@ repos:

# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.6.0"
rev: "v5.0.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -79,7 +79,7 @@ repos:

# Also code format the docs
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
rev: "1.19.1"
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.8"
hooks:
- id: fix-ligatures
- id: fix-smartquotes
Expand All @@ -108,7 +108,7 @@ repos:

# Checks the manifest for missing files (native support)
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
rev: "0.50"
hooks:
- id: check-manifest
# This is a slow hook, so only run this if --hook-stage manual is passed
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.3.2"
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.30.0
hooks:
- id: check-readthedocs
- id: check-github-workflows
Expand Down
Loading

0 comments on commit 72b387c

Please sign in to comment.