Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
270d33b
try out `ui-test` instead of `trybuild`
davidhewitt Mar 6, 2026
985d2d3
clippy
davidhewitt Mar 7, 2026
00c27cf
Merge remote-tracking branch 'origin/main' into ui-test
davidhewitt Mar 7, 2026
2f90d42
fixup several ui-test setups
davidhewitt Mar 8, 2026
4ea3933
attempt to fix CI errors
davidhewitt Mar 8, 2026
d8c5c3d
Merge branch 'main' into ui-test
davidhewitt Mar 20, 2026
ae05fdd
forward cargo target to ui-test
davidhewitt Mar 25, 2026
d598cdb
fix ignore mechanism
davidhewitt Mar 27, 2026
d5df570
Merge branch 'main' into ui-test
davidhewitt Mar 27, 2026
7129160
remove abi3-py37 reference
davidhewitt Mar 27, 2026
50a4e10
apply suggestions from code review
davidhewitt Mar 28, 2026
0818da7
skip ui testing on careful / valgrind
davidhewitt Mar 28, 2026
f26cb22
fixup MSRV handling
davidhewitt Mar 28, 2026
b4d0cff
tidy import
davidhewitt Mar 28, 2026
d645b47
`empty.rs` not a real UI test
davidhewitt Mar 29, 2026
3b891bd
add `.gitattributes`
davidhewitt Mar 29, 2026
d5df48d
clean up ui test harness
davidhewitt Mar 29, 2026
6e92432
fix invalid_cancel_handle test
davidhewitt Mar 29, 2026
eacdcc4
clean up a bunch of cases
davidhewitt Mar 29, 2026
ab88ab7
fix cfg gate on compile error test entry
davidhewitt Mar 29, 2026
cda5152
Merge branch 'main' into ui-test
davidhewitt Apr 17, 2026
1eeea0a
temp format fixes
davidhewitt Apr 17, 2026
1d0d2dc
Merge branch 'main' into ui-test
davidhewitt Apr 29, 2026
139507b
additional normalizations
davidhewitt Apr 29, 2026
9907c95
Merge remote-tracking branch 'origin/main' into ui-test
davidhewitt May 2, 2026
2a5beec
bless changes on 3.10
davidhewitt May 2, 2026
027d8fb
bless tests on 3.14
davidhewitt May 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ jobs:
run: nox -s set-msrv-package-versions

- if: inputs.rust != 'stable'
name: Ignore changed error messages when using trybuild
run: echo "TRYBUILD=overwrite" >> "$GITHUB_ENV"
name: Ignore changed error messages for ui tests (still run for coverage)
run: echo "UI_TEST=ignore" >> "$GITHUB_ENV"

- uses: dorny/paths-filter@v4
if: ${{ inputs.rust == 'stable' && !startsWith(inputs.python-version, 'graalpy') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ jobs:
env:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: valgrind --leak-check=no --error-exitcode=1
RUST_BACKTRACE: 1
TRYBUILD: overwrite
UI_TEST: skip

careful:
if: ${{ contains(github.event.pull_request.labels.*.name, 'CI-build-full') || github.event_name != 'pull_request' }}
Expand All @@ -400,7 +400,7 @@ jobs:
- run: nox -s test-rust -- careful skip-full
env:
RUST_BACKTRACE: 1
TRYBUILD: overwrite
UI_TEST: skip

docsrs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'CI-build-full') || github.event_name != 'pull_request' }}
Expand Down
11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ portable-atomic = "1.0"
assert_approx_eq = "1.1.0"
chrono = "0.4.25"
chrono-tz = ">= 0.10, < 0.11"
trybuild = ">=1.0.115"
proptest = { version = "1.0", default-features = false, features = ["std"] }
send_wrapper = "0.6"
serde = { version = "1.0", features = ["derive"] }
Expand All @@ -80,6 +79,10 @@ tempfile = "3.12.0"
static_assertions = "1.1.0"
uuid = { version = "1.10.0", features = ["v4"] }
parking_lot = { version = "0.12.3", features = ["arc_lock"] }
ui_test = "0.30.4"
regex = "1.12.3"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
ctrlc = "3.5.2"

[build-dependencies]
pyo3-build-config = { path = "pyo3-build-config", version = "=0.28.3", features = ["resolve-config"] }
Expand Down Expand Up @@ -180,6 +183,7 @@ members = [
"pyo3-macros",
"pyo3-macros-backend",
"pyo3-introspection",
"tests/ui/base",
"pytests",
"examples",
]
Expand Down Expand Up @@ -222,3 +226,8 @@ bare_urls = "warn"

[lints]
workspace = true

[[test]]
name = "test_compile_error"
path = "tests/test_compile_error.rs"
harness = false
4 changes: 2 additions & 2 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Use `nox -l` to list the full set of subcommands you can run.

#### UI Tests

PyO3 uses [`trybuild`][trybuild] to develop UI tests to capture error messages from the Rust compiler for some of the macro functionality.
PyO3 uses [`ui_test`][ui_test] to develop UI tests to capture error messages from the Rust compiler for some of the macro functionality.

The Rust compiler's error output differs depending on whether the `rust-src` component is installed. PyO3's CI has `rust-src` installed, so you need it locally for your UI test output to match:

Expand Down Expand Up @@ -265,4 +265,4 @@ In the meanwhile, some of our maintainers have personal GitHub sponsorship pages
[lychee]: https://github.com/lycheeverse/lychee
[nox]: https://github.com/theacodes/nox
[pipx]: https://pipx.pypa.io/stable/
[trybuild]: https://github.com/dtolnay/trybuild
[ui_test]: https://github.com/oli-obk/ui_test
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ def check_feature_powerset(session: nox.Session):
@nox.session(name="update-ui-tests", venv_backend="none")
def update_ui_tests(session: nox.Session):
env = os.environ.copy()
env["TRYBUILD"] = "overwrite"
env["UI_TEST"] = "bless"
command = ["test", "--test", "test_compile_error"]
_run_cargo(session, *command, env=env)
_run_cargo(session, *command, "--features=full", env=env)
Expand Down
Loading
Loading