Skip to content

Commit

Permalink
remove continue-on-error from free-threaded CI job (#4546)
Browse files Browse the repository at this point in the history
* remove continue-on-error from free-threaded CI job

* fix diagnostic message `cfg_attrs`

* disable assert that may not be true on free-threaded build

* Update ci.yml

Co-authored-by: David Hewitt <mail@davidhewitt.dev>

---------

Co-authored-by: David Hewitt <mail@davidhewitt.dev>
  • Loading branch information
ngoldbaum and davidhewitt authored Sep 23, 2024
1 parent 0079003 commit eccff58
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,7 @@ jobs:
- run: python3 -m sysconfig
- run: python3 -m pip install --upgrade pip && pip install nox
- run: nox -s ffi-check
- name: Run default nox sessions that should pass
run: nox -s clippy docs rustfmt ruff
- name: Run PyO3 tests with free-threaded Python (can fail)
# TODO fix the test crashes so we can unset this
continue-on-error: true
run: nox -s test
- run: nox

test-version-limits:
needs: [fmt]
Expand Down
4 changes: 2 additions & 2 deletions src/impl_/pyclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ impl<T> PyClassThreadChecker<T> for ThreadCheckerImpl {
/// Trait denoting that this class is suitable to be used as a base type for PyClass.

#[cfg_attr(
all(diagnostic_namespace, feature = "abi3"),
all(diagnostic_namespace, Py_LIMITED_API),
diagnostic::on_unimplemented(
message = "pyclass `{Self}` cannot be subclassed",
label = "required for `#[pyclass(extends={Self})]`",
Expand All @@ -1124,7 +1124,7 @@ impl<T> PyClassThreadChecker<T> for ThreadCheckerImpl {
)
)]
#[cfg_attr(
all(diagnostic_namespace, not(feature = "abi3")),
all(diagnostic_namespace, not(Py_LIMITED_API)),
diagnostic::on_unimplemented(
message = "pyclass `{Self}` cannot be subclassed",
label = "required for `#[pyclass(extends={Self})]`",
Expand Down
4 changes: 4 additions & 0 deletions tests/test_gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ fn gc_integration() {
Python::with_gil(|py| {
py.run(ffi::c_str!("import gc; gc.collect()"), None, None)
.unwrap();
// threads are resumed before tp_clear() calls finish, so drop might not
// necessarily be called when we get here see
// https://peps.python.org/pep-0703/#stop-the-world
#[cfg(not(Py_GIL_DISABLED))]
assert!(drop_called.load(Ordering::Relaxed));
});
}
Expand Down

0 comments on commit eccff58

Please sign in to comment.