Skip to content

Commit af5c653

Browse files
authored
New python312dev.yml (to replace upstream.yml) (#30006)
* Replace upstream.yml with new python312.yml * Revert "Replace upstream.yml with new python312.yml" This reverts commit 9a6b9b4e6fee7a4b9d88f09f666f7cba9773265a. * Bring back python312.yml as upstream.yml * Move upstream.yml back to python312.yml * Move python312.yml to python312dev.yml * Change label python312dev to gha_wf_python312dev_enable; introduce label gha_wf_ci_disable. * FlakyException failure_point_init debugging prints * Revert "FlakyException failure_point_init debugging prints" This reverts commit d38c9da. * Skip failing test specifically for 3.12alpha6 Root problem: * Up to and including 3.12alpha3: `PyErr_Fetch()` produces the `FlakyException` type. * With 3.12alpha6: `PyErr_Fetch()` produces the `ValueError` type instead. Additional detail: Up to and including 3.12alpha3: only `PyErr_NormalizeException()` hits the `ValueError` in `FlakyException._init__`, but not `PyErr_Fetch()`. * Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): ``` str(OrderedDict([(1, "a"), (2, "b")])) ``` Old: ``` OrderedDict([(1, 'a'), (2, 'b')]) ``` New: ``` OrderedDict({1: 'a', 2: 'b'}) ``` * Document that test_embed is still failing (tested only interactively with locally install 3.12alpha6, but the behavior is exactly the same as previously observed in the GH workflow). * Try again: gha_wf_ci_disable * Give up on trying to use label to disable entire workflow file.
1 parent c310cee commit af5c653

File tree

4 files changed

+148
-115
lines changed

4 files changed

+148
-115
lines changed

.github/workflows/python312dev.yml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: python312dev
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
7+
concurrency:
8+
group: python312dev-${{ github.ref }}
9+
cancel-in-progress: false
10+
11+
env:
12+
PYTEST_TIMEOUT: 300
13+
14+
jobs:
15+
standard:
16+
name: "🐍 3.12-dev • ubuntu-latest • x64"
17+
runs-on: ubuntu-latest
18+
19+
# Hint: Select the label in the PR web view.
20+
if: "contains(github.event.pull_request.labels.*.name, 'gha_wf_python312dev_enable')"
21+
22+
steps:
23+
- name: Show env
24+
run: env
25+
26+
- uses: actions/checkout@v3
27+
28+
- name: Setup Python 3.12-dev
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: "3.12-dev"
32+
33+
- name: Setup Boost
34+
run: sudo apt-get install libboost-dev
35+
36+
- name: Update CMake
37+
uses: jwlawson/[email protected]
38+
39+
- name: Run pip installs
40+
run: |
41+
python -m pip install --upgrade pip
42+
python -m pip install --prefer-binary -r tests/requirements.txt
43+
# python -m pip install --prefer-binary numpy # SLOW
44+
# python -m pip install --prefer-binary scipy # FAILED ~Nov 2022
45+
46+
- name: Show platform info
47+
run: python -m platform
48+
49+
- name: Show CMake version
50+
run: cmake --version
51+
52+
# FIRST BUILD
53+
- name: Configure C++11
54+
run: >
55+
cmake -S . -B build11
56+
-DCMAKE_VERBOSE_MAKEFILE=ON
57+
-DPYBIND11_WERROR=ON
58+
-DDOWNLOAD_CATCH=ON
59+
-DDOWNLOAD_EIGEN=ON
60+
-DCMAKE_CXX_STANDARD=11
61+
-DCMAKE_BUILD_TYPE=Debug
62+
63+
- name: Build C++11
64+
run: cmake --build build11 -j 2
65+
66+
- name: Python tests C++11
67+
run: cmake --build build11 --target pytest -j 2
68+
69+
# python-3.12.0-alpha.1-linux-22.04-x64.tar.gz PASSED
70+
# python-3.12.0-alpha.2-linux-22.04-x64.tar.gz FAILED
71+
# python-3.12.0-alpha.3-linux-22.04-x64.tar.gz FAILED
72+
# python-3.12.0-alpha.6-linux-22.04-x64.tar.gz FAILED
73+
# free(): invalid pointer
74+
# Custom PyConfig
75+
# /home/runner/work/pybind11/pybind11/tests/test_embed/test_interpreter.cpp:175
76+
# /home/runner/work/pybind11/pybind11/tests/test_embed/test_interpreter.cpp:179: FAILED:
77+
# gdb traceback points here:
78+
# https://github.com/python/cpython/blame/54289f85b2af1ecf046089ddf535dda1bdf6af24/Python/import.c#L524
79+
# - name: C++ tests C++11
80+
# run: cmake --build build11 --target cpptest -j 2
81+
82+
- name: Interface test C++11
83+
run: cmake --build build11 --target test_cmake_build
84+
85+
- name: Clean directory
86+
run: git clean -fdx
87+
88+
# SECOND BUILD
89+
- name: Configure C++17
90+
run: >
91+
cmake -S . -B build17
92+
-DCMAKE_VERBOSE_MAKEFILE=ON
93+
-DPYBIND11_WERROR=ON
94+
-DDOWNLOAD_CATCH=ON
95+
-DDOWNLOAD_EIGEN=ON
96+
-DCMAKE_CXX_STANDARD=17
97+
-DCMAKE_BUILD_TYPE=Debug
98+
99+
- name: Build C++17
100+
run: cmake --build build17 -j 2
101+
102+
- name: Python tests C++17
103+
run: cmake --build build17 --target pytest
104+
105+
# - name: C++ tests C++17
106+
# run: cmake --build build17 --target cpptest
107+
108+
- name: Interface test C++17
109+
run: cmake --build build17 --target test_cmake_build
110+
111+
- name: Clean directory
112+
run: git clean -fdx
113+
114+
# THIRD BUILD
115+
- name: Configure C++17 max DPYBIND11_INTERNALS_VERSION
116+
run: >
117+
cmake -S . -B build17max
118+
-DCMAKE_VERBOSE_MAKEFILE=ON
119+
-DPYBIND11_WERROR=ON
120+
-DDOWNLOAD_CATCH=ON
121+
-DDOWNLOAD_EIGEN=ON
122+
-DCMAKE_CXX_STANDARD=17
123+
-DCMAKE_BUILD_TYPE=Debug
124+
-DPYBIND11_INTERNALS_VERSION=10000000
125+
126+
- name: Build C++17 max DPYBIND11_INTERNALS_VERSION
127+
run: cmake --build build17max -j 2
128+
129+
- name: Python tests C++17 max DPYBIND11_INTERNALS_VERSION
130+
run: cmake --build build17max --target pytest
131+
132+
# - name: C++ tests C++17 max DPYBIND11_INTERNALS_VERSION
133+
# run: cmake --build build17max --target cpptest
134+
135+
- name: Interface test C++17 max DPYBIND11_INTERNALS_VERSION
136+
run: cmake --build build17max --target test_cmake_build
137+
138+
# Ensure the setup_helpers module can build packages using setuptools
139+
- name: Setuptools helpers test
140+
run: pytest tests/extra_setuptools
141+
142+
- name: Clean directory
143+
run: git clean -fdx

.github/workflows/upstream.yml

Lines changed: 0 additions & 114 deletions
This file was deleted.

tests/test_exceptions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ def test_error_already_set_what_with_happy_exceptions(
317317
assert what == expected_what
318318

319319

320+
@pytest.mark.skipif(
321+
# Intentionally very specific:
322+
"sys.version_info == (3, 12, 0, 'alpha', 6)",
323+
reason="Suspected bug in 3.12alpha6",
324+
)
320325
@pytest.mark.skipif("env.PYPY", reason="PyErr_NormalizeException Segmentation fault")
321326
def test_flaky_exception_failure_point_init():
322327
with pytest.raises(RuntimeError) as excinfo:

tests/test_modules.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def test_importing():
6363
from pybind11_tests.modules import OD
6464

6565
assert OD is OrderedDict
66-
assert str(OD([(1, "a"), (2, "b")])) == "OrderedDict([(1, 'a'), (2, 'b')])"
6766

6867

6968
def test_pydoc():

0 commit comments

Comments
 (0)