chore(deps): update rust crate pyo3 to 0.22.0
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| pyo3 | workspace.dependencies | minor | 0.21.2 -> 0.22.0 |
Release Notes
pyo3/pyo3 (pyo3)
v0.22.2
Packaging
- Require opt-in to freethreaded Python using the
UNSAFE_PYO3_BUILD_FREE_THREADED=1environment variable (it is not yet supported by PyO3). #4327
Changed
- Use FFI function calls for reference counting on all abi3 versions. #4324
#[pymodule(...)]now directly accepts all relevant#[pyo3(...)]options. #4330
Fixed
- Fix compile failure in declarative
#[pymodule]under presence of#![no_implicit_prelude]. #4328 - Fix compile failure due to c-string literals on Rust < 1.79. #4353
v0.22.1
Added
- Add
#[pyo3(submodule)]option for declarative#[pymodule]s. #4301 - Implement
PartialEq<bool>forBound<'py, PyBool>. #4305
Fixed
- Return
NotImplementedinstead of raisingTypeErrorfrom generated equality method when comparing different types. #4287 - Handle full-path
#[pyo3::prelude::pymodule]and similar for#[pyclass]and#[pyfunction]in declarative modules.#4288 - Fix 128-bit int regression on big-endian platforms with Python <3.13. #4291
- Stop generating code that will never be covered with declarative modules. #4297
- Fix invalid deprecation warning for trailing optional on
#[setter]function. #4304
v0.22.0
Packaging
- Update
heckdependency to 0.5. #3966 - Extend range of supported versions of
chrono-tzoptional dependency to include version 0.10. #4061 - Update MSRV to 1.63. #4129
- Add optional
num-rationalfeature to add conversions with Python'sfractions.Fraction. #4148 - Support Python 3.13. #4184
Added
- Add
PyWeakref,PyWeakrefReferenceandPyWeakrefProxy. #3835 - Support
#[pyclass]on enums that have tuple variants. #4072 - Add support for scientific notation in
Decimalconversion. #4079 - Add
pyo3_disable_reference_poolconditional compilation flag to avoid the overhead of the global reference pool at the cost of known limitations as explained in the performance section of the guide. #4095 - Add
#[pyo3(constructor = (...))]to customize the generated constructors for complex enum variants. #4158 - Add
PyType::module, which always matches Python__module__. #4196 - Add
PyType::fully_qualified_namewhich matches the "fully qualified name" defined in PEP 737. #4196 - Add
PyTypeMethods::mroandPyTypeMethods::bases. #4197 - Add
#[pyclass(ord)]to implement ordering based onPartialOrd. #4202 - Implement
ToPyObjectandIntoPy<PyObject>forPyBackedStrandPyBackedBytes. #4205 - Add
#[pyclass(hash)]option to implement__hash__in terms of theHashimplementation #4206 - Add
#[pyclass(eq)]option to generate__eq__based onPartialEq, and#[pyclass(eq_int)]for simple enums to implement equality based on their discriminants. #4210 - Implement
From<Bound<'py, T>>forPyClassInitializer<T>. #4214 - Add
as_supermethods toPyRefandPyRefMutfor accesing the base class by reference. #4219 - Implement
PartialEq<str>forBound<'py, PyString>. #4245 - Implement
PyModuleMethods::filenameon PyPy. #4249 - Implement
PartialEq<[u8]>forBound<'py, PyBytes>. #4250 - Add
pyo3_ffi::c_strmacro to create&'static CStron Rust versions which don't have 1.77'sc""literals. #4255 - Support
boolconversion withnumpy2.0'snumpy.booltype #4258 - Add
PyAnyMethods::{bitnot, matmul, floor_div, rem, divmod}. #4264
Changed
- Change the type of
PySliceIndices::slicelengthand thelengthparameter ofPySlice::indices(). #3761 - Deprecate implicit default for trailing optional arguments #4078
Cloneing pointers into the Python heap has been moved behind thepy-clonefeature, as it must panic without the GIL being held as a soundness fix. #4095- Add
#[track_caller]to allPy<T>,Bound<'py, T>andBorrowed<'a, 'py, T>methods which can panic. #4098 - Change
PyAnyMethods::dirto be fallible and returnPyResult<Bound<'py, PyList>>(and similar forPyAny::dir). #4100 - The global reference pool (to track pending reference count decrements) is now initialized lazily to avoid the overhead of taking a mutex upon function entry when the functionality is not actually used. #4178
- Emit error messages when using
weakrefordictwhen compiling forabi3for Python older than 3.9. #4194 - Change
PyType::nameto always match Python__name__. #4196 - Remove CPython internal ffi call for complex number including: add, sub, mul, div, neg, abs, pow. Added PyAnyMethods::{abs, pos, neg} #4201
- Deprecate implicit integer comparision for simple enums in favor of
#[pyclass(eq_int)]. #4210 - Set the
module=attribute of declarative modules' child#[pymodule]s and#[pyclass]es. #4213 - Set the
moduleoption for complex enum variants from the value set on the complex enummodule. #4228 - Respect the Python "limited API" when building for the
abi3feature on PyPy or GraalPy. #4237 - Optimize code generated by
#[pyo3(get)]on#[pyclass]fields. #4254 PyCFunction::new,PyCFunction::new_with_keywordsandPyCFunction::new_closurenow take&'static CStrname and doc arguments (previously was&'static str). #4255- The
experimental-declarative-modulesfeature is now stabilized and available by default. #4257
Fixed
- Fix panic when
PYO3_CROSS_LIB_DIRis set to a missing path. #4043 - Fix a compile error when exporting an exception created with
create_exception!living in a different Rust module using thedeclarative-modulefeature. #4086 - Fix FFI definitions of
PY_VECTORCALL_ARGUMENTS_OFFSETandPyVectorcall_NARGSto fix a false-positive assertion. #4104 - Disable
PyUnicode_DATAon PyPy: not exposed by PyPy. #4116 - Correctly handle
#[pyo3(from_py_with = ...)]attribute on dunder (__magic__) method arguments instead of silently ignoring it. #4117 - Fix a compile error when declaring a standalone function or class method with a Python name that is a Rust keyword. #4226
- Fix declarative modules discarding doc comments on the
modnode. #4236 - Fix
__dict__attribute missing for#[pyclass(dict)]instances when building forabi3on Python 3.9. #4251
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
- any of the package files in this branch needs updating, or
- the branch becomes conflicted, or
- you click the rebase/retry checkbox if found above, or
- you rename this PR's title to start with "rebase!" to trigger it manually
The artifact failure details are included below:
File name: Cargo.lock
Command failed: cargo update --config net.git-fetch-with-cli=true --manifest-path Cargo.toml --workspace
Updating crates.io index
error: failed to select a version for `pyo3`.
... required by package `pyvortex v0.7.0 (/tmp/renovate/repos/github/spiraldb/vortex/pyvortex)`
versions that meet the requirements `^0.22.0` are: 0.22.2, 0.22.1, 0.22.0
the package `pyo3` links to the native library `python`, but it conflicts with a previous package which links to `python` as well:
package `pyo3 v0.21.1`
... which satisfies dependency `pyo3 = "^0.21.1"` of package `arrow v52.2.0`
... which satisfies dependency `arrow = "^52.0.0"` of package `pyvortex v0.7.0 (/tmp/renovate/repos/github/spiraldb/vortex/pyvortex)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "python"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.
failed to select a version for `pyo3` which could resolve this conflict
this will unblock once we upgrade arrow-rs to the yet-unreleased 53.0.0 https://github.com/apache/arrow-rs/pull/6126/files#diff-f4a8850fc9135e5fc32c7c537d6a615478d4924f05151f466f5784f3aa8b8611R57