Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Dec 20, 2022
2 parents 5b63222 + 0694ec6 commit d36a41e
Show file tree
Hide file tree
Showing 62 changed files with 2,958 additions and 1,040 deletions.
22 changes: 19 additions & 3 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ body:
- type: markdown
attributes:
value: |
Maintainers will only make a best effort to triage PRs. Please do your best to make the issue as easy to act on as possible, and only open if clearly a problem with pybind11 (ask first if unsure).
Please do your best to make the issue as easy to act on as possible, and only submit here if there is clearly a problem with pybind11 (ask first if unsure). **Note that a reproducer in a PR is much more likely to get immediate attention.**
- type: checkboxes
id: steps
attributes:
Expand All @@ -20,6 +21,13 @@ body:
- label: Consider asking first in the [Gitter chat room](https://gitter.im/pybind/Lobby) or in a [Discussion](https:/pybind/pybind11/discussions/new).
required: false

- type: input
id: version
attributes:
label: What version (or hash if on master) of pybind11 are you using?
validations:
required: true

- type: textarea
id: description
attributes:
Expand All @@ -40,6 +48,14 @@ body:
The code should be minimal, have no external dependencies, isolate the
function(s) that cause breakage. Submit matched and complete C++ and
Python snippets that can be easily compiled and run to diagnose the
issue. If possible, make a PR with a new, failing test to give us a
starting point to work on!
issue. — Note that a reproducer in a PR is much more likely to get
immediate attention: failing tests in the pybind11 CI are the best
starting point for working out fixes.
render: text

- type: input
id: regression
attributes:
label: Is this a regression? Put the last known working version here if it is.
description: Put the last known working version here if this is a regression.
value: Not a regression
153 changes: 145 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ env:
PIP_ONLY_BINARY: numpy
FORCE_COLOR: 3
PYTEST_TIMEOUT: 300
# For cmake:
VERBOSE: 1

jobs:
# This is the "main" test suite, which tests a large number of different
Expand All @@ -25,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, windows-2022, macos-latest]
runs-on: [ubuntu-20.04, windows-2022, macos-latest]
python:
- '3.6'
- '3.9'
Expand All @@ -42,12 +44,12 @@ jobs:
# We support an optional key: args, for cmake args
include:
# Just add a key
- runs-on: ubuntu-latest
- runs-on: ubuntu-20.04
python: '3.6'
args: >
-DPYBIND11_FINDPYTHON=ON
-DCMAKE_CXX_FLAGS="-D_=1"
- runs-on: ubuntu-latest
- runs-on: ubuntu-20.04
python: 'pypy-3.8'
args: >
-DPYBIND11_FINDPYTHON=ON
Expand Down Expand Up @@ -194,13 +196,13 @@ jobs:
python-debug: false

name: "🐍 ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64"
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Setup Python ${{ matrix.python-version }} (deadsnakes)
uses: deadsnakes/action@v2.1.1
uses: deadsnakes/action@v3.0.0
with:
python-version: ${{ matrix.python-version }}
debug: ${{ matrix.python-debug }}
Expand Down Expand Up @@ -918,7 +920,7 @@ jobs:
- name: Configure C++11
# LTO leads to many undefined reference like
# `pybind11::detail::function_call::function_call(pybind11::detail::function_call&&)
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 -DCMAKE_VERBOSE_MAKEFILE=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -S . -B build
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -S . -B build

- name: Build C++11
run: cmake --build build -j 2
Expand All @@ -936,7 +938,7 @@ jobs:
run: git clean -fdx

- name: Configure C++14
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DCMAKE_VERBOSE_MAKEFILE=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -S . -B build2
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -S . -B build2

- name: Build C++14
run: cmake --build build2 -j 2
Expand All @@ -954,7 +956,7 @@ jobs:
run: git clean -fdx

- name: Configure C++17
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DCMAKE_VERBOSE_MAKEFILE=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -S . -B build3
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -S . -B build3

- name: Build C++17
run: cmake --build build3 -j 2
Expand All @@ -967,3 +969,138 @@ jobs:

- name: Interface test C++17
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cmake_build

windows_clang:

strategy:
matrix:
os: [windows-latest]
python: ['3.10']

runs-on: "${{ matrix.os }}"

name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-latest"

steps:
- name: Show env
run: env

- name: Checkout
uses: actions/checkout@v3

- name: Set up Clang
uses: egor-tensin/setup-clang@v1

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

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

- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3

- name: Run pip installs
run: |
python -m pip install --upgrade pip
python -m pip install -r tests/requirements.txt
- name: Show Clang++ version
run: clang++ --version

- name: Show CMake version
run: cmake --version

# TODO: WERROR=ON
- name: Configure Clang
run: >
cmake -G Ninja -S . -B .
-DPYBIND11_WERROR=OFF
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_STANDARD=17
- name: Build
run: cmake --build . -j 2

- name: Python tests
run: cmake --build . --target pytest -j 2

- name: C++ tests
run: cmake --build . --target cpptest -j 2

- name: Interface test
run: cmake --build . --target test_cmake_build -j 2

- name: Clean directory
run: git clean -fdx

macos_brew_install_llvm:
name: "macos-latest • brew install llvm"
runs-on: macos-latest

env:
# https://apple.stackexchange.com/questions/227026/how-to-install-recent-clang-with-homebrew
LDFLAGS: '-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib'

steps:
- name: Update PATH
run: echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH

- name: Show env
run: env

- name: Checkout
uses: actions/checkout@v3

- name: Show Clang++ version before brew install llvm
run: clang++ --version

- name: brew install llvm
run: brew install llvm

- name: Show Clang++ version after brew install llvm
run: clang++ --version

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

- name: Run pip installs
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r tests/requirements.txt
python3 -m pip install numpy
python3 -m pip install scipy
- name: Show CMake version
run: cmake --version

- name: CMake Configure
run: >
cmake -S . -B .
-DPYBIND11_WERROR=ON
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_STANDARD=17
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
- name: Build
run: cmake --build . -j 2

- name: Python tests
run: cmake --build . --target pytest -j 2

- name: C++ tests
run: cmake --build . --target cpptest -j 2

- name: Interface test
run: cmake --build . --target test_cmake_build -j 2

- name: Clean directory
run: git clean -fdx
8 changes: 6 additions & 2 deletions .github/workflows/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@ on:
- stable
- v*

env:
# For cmake:
VERBOSE: 1

jobs:
# This tests various versions of CMake in various combinations, to make sure
# the configure step passes.
cmake:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, macos-latest, windows-latest]
runs-on: [ubuntu-20.04, macos-latest, windows-latest]
arch: [x64]
cmake: ["3.23"]

include:
- runs-on: ubuntu-latest
- runs-on: ubuntu-20.04
arch: x64
cmake: 3.4

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:

env:
FORCE_COLOR: 3
# For cmake:
VERBOSE: 1

jobs:
pre-commit:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ jobs:
steps:

- uses: actions/labeler@main
if: github.event.pull_request.merged == true
if: >
github.event.pull_request.merged == true &&
!startsWith(github.event.pull_request.title, 'chore(deps):') &&
!startsWith(github.event.pull_request.title, 'ci(fix):') &&
!startsWith(github.event.pull_request.title, 'docs(changelog):')
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler_merged.yml
4 changes: 2 additions & 2 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.5.1
uses: pypa/gh-action-pypi-publish@v1.6.4
with:
password: ${{ secrets.pypi_password }}
packages_dir: standard/

- name: Publish global package
uses: pypa/gh-action-pypi-publish@v1.5.1
uses: pypa/gh-action-pypi-publish@v1.6.4
with:
password: ${{ secrets.pypi_password_global }}
packages_dir: global/
2 changes: 2 additions & 0 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ concurrency:

env:
PIP_ONLY_BINARY: numpy
# For cmake:
VERBOSE: 1

jobs:
standard:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ pybind11Targets.cmake
/pybind11/share/*
/docs/_build/*
.ipynb_checkpoints/
tests/main.cpp

0 comments on commit d36a41e

Please sign in to comment.