* feat!: drop support for Python 3.8 The minimum supported version is now Python 3.9. pybind11 v3.0 was the last release that supports Python 3.8. The deprecation note said that support goes away in 3.1. Remove the code paths that this makes dead: - the `_PyObject_Vectorcall` fallback in `cast.h` - the `frame->f_code` and `frame->f_back` fallbacks in `pytypes.h` - the `PyFrame_FastToLocals` path in `get_type_override` - the conditional `Py_VISIT(Py_TYPE(self))` in `tp_traverse` - `PYBIND11_PYCONFIG_SUPPORT_PY_VERSION_HEX`, the pre-PyConfig interpreter init, and the `widen_chars` helpers in `embed.h` Assisted-by: ClaudeCode:claude-opus-5 * ci(appveyor): use Python 3.9 The AppVeyor job set `PYTHON: 38`, which makes the path `C:\Python38`. The image gives Python 3.9.13 as `C:\Python39`. Assisted-by: ClaudeCode:claude-opus-5 * feat!: require MSVC 2019 or newer Python 3.9 is the new minimum, so MSVC 2017 is no longer needed. Raise the compile-time floor to _MSC_VER 1920 and remove the workarounds that only applied below it: std::launder, fold expressions, weak_from_this, aligned new/delete, the C4100 warning helper, and the func_handle syntax error. AppVeyor now builds with Visual Studio 2019. Assisted-by: ClaudeCode:claude-opus-5 * fix(appveyor): build against the Python that has the test packages CMake 4 has no FindPythonLibs, so pybind11 uses FindPython. FindPython reads the registry before PATH and selected `C:\Python314-x64`, but the test packages go into the Python on PATH. Pass `Python_ROOT_DIR` to name the correct one. Also set `CMAKE_ARCH`. It was never set, so the architecture came from the generator. Visual Studio 2017 defaults to Win32, but Visual Studio 2019 defaults to x64, which made this x86 job build 64-bit code. Assisted-by: ClaudeCode:claude-opus-5 * fix(appveyor): give the linker Python's libs directory The build compiled but failed to link with LNK1104 on a bare `python39.lib`. That name comes from the `#pragma comment(lib, ...)` in pyconfig.h, so the linker needs the directory. CMake 4 has no FindPythonLibs, and FindPython does not add it for this Debug x86 build. Put it on LIB instead. The directory listing is temporary, to confirm the library is present. Assisted-by: ClaudeCode:claude-opus-5 * fix(appveyor): link the release Python library in Debug The image ships python39_d.lib next to python39.lib, so FindPython picks the debug import library for a Debug build. pybind11 undefines _DEBUG around Python.h, so pyconfig.h asks for python39.lib instead and the link failed with LNK1104. Name the release library for the debug slot. Setting LIB does not work, because MSBuild replaces it from the toolset, and it would link both import libraries. Assisted-by: ClaudeCode:claude-opus-5 * chore(appveyor): print link settings to debug LNK1104 Revert the two attempted fixes. Neither changed the failure: setting LIB does not survive MSBuild, and naming the release library for Python_LIBRARY_DEBUG had no effect. Print the Python cache entries and the link settings of a generated project file instead, to see what the linker really gets. Temporary. Assisted-by: ClaudeCode:claude-opus-5 * fix(appveyor): take the release Python library in Debug The generated project file linked C:\Python39\libs\python39_d.lib in the Debug configuration, because the image ships debug binaries next to the release ones. pybind11 undefines _DEBUG around Python.h, so pyconfig.h asks for python39.lib in a #pragma comment(lib), which nothing on the link line satisfies and no library directory holds. Map Debug to the release artifacts. Assisted-by: ClaudeCode:claude-opus-5 * chore(appveyor): drop the temporary link diagnostic Assisted-by: ClaudeCode:claude-opus-5 * fix(tests): guard the unraisable warning filter for pytest < 6 The distro pytest in the Clang and GCC Docker jobs has no PytestUnraisableExceptionWarning, so an unconditional filterwarnings mark makes pytest fail with an INTERNALERROR after the tests pass. Assisted-by: ClaudeCode:claude-opus-5 Claude-Session: https://claude.ai/code/session_01Aimf6HuSz1vLRwBnbxmCTc * docs: address review items on version hints, embed docs, and a PyPy xfail Extend Python_ADDITIONAL_VERSIONS through 3.15, describe the PyConfig behavior of initialize_interpreter, and drop the stale Python 3.8 wording from the PyPy xfail reason. Assisted-by: ClaudeCode:claude-opus-5 * Update README.rst Co-authored-by: Ralf W. Grosse-Kunstleve <rwgkio@gmail.com> --------- Co-authored-by: Ralf W. Grosse-Kunstleve <rwgkio@gmail.com>
104 lines
2.8 KiB
YAML
104 lines
2.8 KiB
YAML
name: Reusable Standard Test
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
python-version:
|
|
required: true
|
|
type: string
|
|
cmake-args:
|
|
required: false
|
|
type: string
|
|
default: ''
|
|
runs-on:
|
|
required: true
|
|
type: string
|
|
|
|
env:
|
|
PYTHONDEVMODE: 1
|
|
PIP_BREAK_SYSTEM_PACKAGES: 1
|
|
PIP_ONLY_BINARY: numpy
|
|
FORCE_COLOR: 3
|
|
PYTEST_TIMEOUT: 300
|
|
# For cmake:
|
|
VERBOSE: 1
|
|
CMAKE_COLOR_DIAGNOSTICS: 1
|
|
|
|
jobs:
|
|
standard:
|
|
name: 🧪
|
|
runs-on: ${{ inputs.runs-on }}
|
|
timeout-minutes: 90
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Setup Python ${{ inputs.python-version }}
|
|
id: python
|
|
uses: actions/setup-python@v7
|
|
with:
|
|
python-version: ${{ inputs.python-version }}
|
|
allow-prereleases: true
|
|
# Python 3.13.4 broken on Windows
|
|
check-latest: >-
|
|
${{ inputs.python-version == '3.13' && runner.os == 'Windows' }}
|
|
|
|
- name: Setup Boost (Linux)
|
|
if: runner.os == 'Linux'
|
|
run: sudo apt-get update && sudo apt-get install -y libboost-dev
|
|
|
|
- name: Setup Boost (macOS)
|
|
if: runner.os == 'macOS'
|
|
run: brew install boost
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v9.0.0
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Prepare env
|
|
run: uv pip install --python=python --system -r tests/requirements.txt
|
|
|
|
- name: Setup annotations on Linux
|
|
if: runner.os == 'Linux'
|
|
run: uv pip install --python=python --system pytest-github-actions-annotate-failures
|
|
|
|
# TODO Resolve Windows Ninja shared object issue on Python 3.9+
|
|
- name: Use Ninja except on Windows
|
|
if: runner.os != 'Windows'
|
|
run: echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV"
|
|
|
|
# Pass setup-python's resolved interpreter path to CMake so FindPython
|
|
# does not select a different interpreter (e.g. Homebrew's 3.14 instead
|
|
# of setup-python's 3.14t).
|
|
- name: Configure
|
|
run: >
|
|
cmake -S. -Bbuild -Werror=dev
|
|
-DPYBIND11_WERROR=ON
|
|
-DPYBIND11_PYTEST_ARGS=-v
|
|
-DDOWNLOAD_CATCH=ON
|
|
-DDOWNLOAD_EIGEN=ON
|
|
-DPYTHON_EXECUTABLE=${{ steps.python.outputs.python-path }}
|
|
${{ inputs.cmake-args }}
|
|
|
|
- name: Build
|
|
run: cmake --build build
|
|
|
|
- name: Python tests
|
|
run: cmake --build build --target pytest
|
|
|
|
- name: C++ tests
|
|
timeout-minutes: 3
|
|
run: cmake --build build --target cpptest
|
|
|
|
- name: Interface test
|
|
run: cmake --build build --target test_cmake_build
|
|
|
|
- name: Visibility test
|
|
run: cmake --build build --target test_cross_module_rtti
|
|
|
|
- name: Setuptools helpers test
|
|
run: |
|
|
uv pip install --python=python --system setuptools
|
|
pytest tests/extra_setuptools
|