Repository navigation
add python 3.15 support - #176
Conversation
|
@abraaoz Hello! Thanks for python3.15 support. I approved the checks, let's see it everything is ok |
|
Thanks for approving the run! The 27 red boxes are one real failure and 26 cancellations from I pushed that one line to the test workflow and to the four setup-python steps in Could you approve the run again so we see how far the build gets on 3.15? |
… suite on 3.15, pyo3 0.29.3
|
Python 3.15.0 is out, so I moved the branch from the release candidate to the final release:
Verified locally on CPython 3.15.0 (macOS arm64) against PostgreSQL 18 with TLS on: 274 passed, 0 failed, The run on my previous push never started (0 jobs), so could you approve the workflows once more? Side note: |
|
@abraaoz Hello! Thanks for the fixes, I approved the run, let's check. |
Adds CPython 3.15 to the supported versions. Unlike the 3.14 PR (#159), the CI matrix alone is not enough:
pyo30.25.1 refuses the interpreter outright (the configured Python interpreter version (3.15) is newer than), andPYO3_USE_ABI3_FORWARD_COMPATIBILITY=1does not help, it gets past the version check and then fails to compile (the trait bound PyTime: PyTypeInfo is not satisfied, 4 errors). So this bumpspyo30.25.1 -> 0.29 and migrates the code with it.Migrations applied, all from PyO3's own migration guide
Python::with_gil->Python::attach.downcast*()->.cast*()GILOnceCell->PyOnceLockFromPyObject<'py>->FromPyObject<'_, 'py>withtype Errorandextract(Borrowed<..>)pyo3::PyObject->Py<PyAny>(alias deprecated)conversion::FromPyObjectBound->FromPyObjectTaskLocals::clone_ref->cloneTwo that are not renames:
rustdriver_future'sTgainsSend + 'static, whichpyo3_async_runtimes::tokio::future_into_pynow requires.extract::<T>()on a#[pyclass]returnsPyClassGuardError, whichRustPSQLDriverErrorcannot absorb. Converted viaPyErrat the two macro sites, sinceRustPSQLDriverError::RustPyErroralready carries#[from] pyo3::PyErr.Verified
Built and installed against CPython 3.15.0 (final) on macOS arm64, then ran the whole suite against PostgreSQL 18 with TLS on: 274 passed, 0 failed,
test_ssl_mode.pyandtest_binary_copy.pyincluded (pyarrow 26.0.0 ships cp315 wheels, and pgpq is abi3).Your
prekhooks pass locally on Rust 1.98.0 and 1.99.0, read from their exit codes:cargo fmt --checkwith your config,cargo clippy -p psqlpy -- -W clippy::all -W clippy::pedantic -D warnings(and the CI job's--all-featuresvariant), andcargo check, all 0. Clippy 1.99 needs pyo3 0.29.3, which fixesclone_on_copylints its#[pyclass]macros emitted onCopytypes.One lint that is new, not broken
Clippy 1.98 adds
clippy::unused_async_trait_impl, split out ofunused_async, and pyo3 0.29 expands async#[pymethods]as trait impls, so it fires on four functions that already carry#[allow(clippy::unused_async)]. The new name was added beside the old one rather than restructuring those functions intoimpl Future, since theasyncthere is your choice about the Python-facing API.One unrelated line
src/statement/query.rs:53hadformat!("${}", &counter), which current clippy rejects as a redundant reference. It is not part of this migration and I did not otherwise touch that file, but the hook lints the whole crate, so the branch cannot go green without it. Dropped toformat!("${counter}").Two things for you to decide
pyo3-async-runtimesnow points at the released crate (0.29) instead of your fork'spsqlpybranch. The fork is pinned to the old pyo3 line and does not build against 0.29; upstream has since published 0.29.0. I do not know what your fork carries that upstream does not, so if that branch holds a patch you need, this dependency line should be rebased instead of replaced. That is your call, not mine.All 20
#[pyclass]types opted IN to theFromPyObjectderive. PyO3 0.29 makes that derive opt-in for#[pyclass]types implementingClone, andprekruns clippy with-D warnings, so the deprecation is a hard failure rather than a note. Every one of them gotfrom_py_object, which keeps today's behaviour exactly;skip_from_py_objectwould have removed those conversions from your public API, which is not a migration PR's call to make.