This release is a set of touch-ups to PyO3 0.21 to fix cases found as adoption of PyO3 0.21.0 progressed.
The new PyBackedStr and PyBackedBytes types have had a large range of standard traits implemented, including Clone, PartialEq, Hash, PartialOrd, Display, Debug, Send and Sync.
The argument to a #[setter] function now accepts the full range of input types as any other function argument in a #[pymethods] block, and will now correctly handle a #[pyo3(from_py_with = "...")] annotation.
Some procedural macro output has been adjusted to reuse more code and make it easier to reach complete code coverage in projects using PyO3. The import_exception_bound! macro has been added to further assist with coverage during migration, by skipping generating code which is only needed to use the exception as a GIL Ref.
Finally, the experimental-async feature now correctly handles async fn in #[pymethods] which have a &self or &mut self receiver plus additional arguments.
Thank you to the following users for the improvements:
This release introduces a substantial new direction for PyO3's API. The Bound<'py, T> smart pointer type has been added that replaces "GIL Refs" such as &'py PyAny and &'py PyList with smart-pointer forms Bound<'py, PyAny> and Bound<'py, PyList>. This new smart pointer brings ownership out of PyO3's internals and into user control. This has been done for sake of both performance and soundness.
The migration guide extensively details the intended transition to the new API. To allow users a more graceful upgrade path, PyO3 0.21 and 0.22 will maintain backwards compatibility support for the existing "GIL Refs" API.
As well as the Bound API, highlights of PyO3 0.21 include:
Support for compiling for GraalPy
Extended chrono / datetime conversions, including support for the abi3 feature and the chrono-tz crate
Simplifications to __next__ and __anext__ methods
PyO3 0.21 also includes two new experimental features:
experimental-async for a simple async fn integration between Rust and Python.
experimental-declarative-modules for a new simpler #[pymodule] syntax.
There have been numerous other smaller improvements, changes and fixes. For full details see the CHANGELOG.
Thank you to everyone who contributed code, documentation, design ideas, bug reports, and feedback. The following users' commits are included in this release:
FromPyObject, IntoPy<PyObject> and ToPyObject are implemented on std::duration::Duration#3670
Add PyString::to_cow. Add Py<PyString>::to_str, Py<PyString>::to_cow, and Py<PyString>::to_string_lossy, as ways to access Python string data safely beyond the GIL lifetime. #3677
Add Bound<T> and Borrowed<T> smart pointers as a new API for accessing Python objects. #3686
Add PyNativeType::as_borrowed to convert "GIL refs" to the new Bound smart pointer. #3692
Add FromPyObject::extract_bound method, to migrate FromPyObject implementations to the Bound API. #3706
Add gil-refs feature to allow continued use of the deprecated GIL Refs APIs. #3707
Add methods to PyAnyMethods for binary operators (add, sub, etc.) #3712
Add chrono-tz feature allowing conversion between chrono_tz::Tz and zoneinfo.ZoneInfo#3730
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the deps group with 12 updates:
0.1.77
0.1.79
1.36.0
1.37.0
4.5.1
4.5.4
0.11.2
0.11.3
0.20.3
0.21.1
1.0.114
1.0.115
0.8.10
0.8.12
1.10.3
1.10.4
1.0.80
1.0.81
1.0.57
1.0.58
2.1.4
2.1.5
0.11.24
0.12.2
Updates
async-trait
from 0.1.77 to 0.1.79Release notes
Sourced from async-trait's releases.
Commits
1eb21ed
Release 0.1.7982cb95c
Resolve unused field of ReplaceSelf syntax tree visitorcd8286b
Update ui test suite to nightly-2024-03-22c73061d
Release 0.1.78b6314bc
Refactor inferred bound filtering8d51928
Merge pull request #262 from dtolnay/asyncspanc98a408
Minimize use of async token's span in expanded code2f5343c
Merge pull request #261 from dtolnay/inferredbound1a01bb4
Skip needlessly generating inferred bounds during ?Sende68d68c
Merge pull request #260 from dtolnay/qualificationsUpdates
tokio
from 1.36.0 to 1.37.0Release notes
Sourced from tokio's releases.
... (truncated)
Commits
9c337ca
chore: prepare Tokio v1.37.0 (#6435)e542501
io: document cancel safety ofAsyncBufReadExt::fill_buf
(#6431)4601c84
stream: addnext_many
andpoll_next_many
toStreamMap
(#6409)deff252
util: document cancel safety ofSinkExt::send
andStreamExt::next
(#6417)4565b81
sync: add arwlock()
method to ownedRwLock
guards (#6418)3ce4720
sync: addis_closed
,is_empty
, andlen
to mpsc receivers (#6348)8342e4b
util: assert compatibility betweenLengthDelimitedCodec
options (#6414)4c453e9
readme: add description about benchmarks (#6425)1846483
sync: expose strong and weak counts of mpsc sender handles (#6405)baad270
sync: add Semaphore example for limiting the number of outgoing requests (#6419)Updates
clap
from 4.5.1 to 4.5.4Release notes
Sourced from clap's releases.
Changelog
Sourced from clap's changelog.
Commits
5e4facf
chore: Release8880b0a
docs: Update changelog132b5dd
Merge pull request #5425 from epage/litdf915fe
fix(derive): Re-allow expressions for id's8eab48f
refactor(derive): Make it easier to work with 'Name'be73195
refactor(derive): Clarify tests024089b
Merge pull request #5415 from Pi-Cla/patch-13b35dba
docs: Add mention of nushell to clap_complete README58469d1
Merge pull request #5405 from epage/docs655d829
docs(derive): Fix ToC links within tutorial chaptersUpdates
env_logger
from 0.11.2 to 0.11.3Release notes
Sourced from env_logger's releases.
Changelog
Sourced from env_logger's changelog.
Commits
98ce803
chore: Release7a16130
docs: Update changeloge55af6f
Merge pull request #137 from tmccombs/structuredf6e2d45
feat(kv): Use now-stable kv feature of log crate9f4a33a
feat(kv): Add styling for key in default format9d26ad5
feat: Add support for Key-Value data in log records8962096
Merge pull request #314 from rust-cli/renovate/pre-commit-action-3.x4127228
chore(deps): update pre-commit/action action to v3.0.1Updates
pyo3
from 0.20.3 to 0.21.1Release notes
Sourced from pyo3's releases.
... (truncated)
Changelog
Sourced from pyo3's changelog.
... (truncated)
Commits
4168d05
release: 0.21.18cabd26
docs: updates to guide for PyO3 0.21 feedback (#4031)8f87b86
refactor#[setter]
argument extraction (#4002)63ba371
added various std traits forPyBackedStr
andPyBackedBytes
(#4020)336b1c9
addimport_exception_bound!
macro (#4027)3af9a1f
docs: fix example in types.md (#4028)cff4aa3
ci: defer test-debug to the merge queue (#4023)9d932c1
add#[inline]
hints on manyBound
andBorrowed
methods (#4024)22e8dd1
add benchmark for class / method calls (#4016)74d9d23
async method should allow args not only receiver (#4015)Updates
serde_json
from 1.0.114 to 1.0.115Release notes
Sourced from serde_json's releases.
Commits
b1ebf38
Release 1.0.115c3dc153
Merge pull request #1119 from titaniumtraveler/pr218770b
Explicitly install a Rust toolchain for cargo-outdated job840da8e
Fix missing backticks in doc comments3a3f61b
Temporarily disable miri on doctests4a0be88
Format regression tests with rustfmtd2dbbf7
Ignore dead code lint in tests8e7b37b
Merge pull request #1118 from serde-rs/transparenta25f6c6
Remove conditional on repr(transparent)fedf834
Ignore non_local_definitions false positive in testUpdates
toml
from 0.8.10 to 0.8.12Commits
3a777b3
chore: Release7979905
docs: Update changelog487768d
Merge pull request #703 from epage/overflow6987f77
chore(ci): Run with default opt-level21f545d
fix(parser): Don't stackoverflow on opt-level=0af1f97d
refactor(parser): Pull recursion limit out to variableeb86543
chore: Release246b292
docs: Update changelogd41c62c
Merge pull request #701 from epage/cleanup31457b3
refactor(error): Clean up highlight codeUpdates
regex
from 1.10.3 to 1.10.4Commits
aa2d8bd
1.10.4088d7f3
api: add Cow guarantee to replace APIa5ae351
regex-automata-0.4.69cf4a42
automata: fix bug where reverse NFA lacked an unanchored prefix10fe722
style: clean up some recent lint violationsd7f9347
regex-automata-0.4.507ef7f1
automata: make additional prefileter metadata publicUpdates
anyhow
from 1.0.80 to 1.0.81Release notes
Sourced from anyhow's releases.
Commits
4aad4ed
Release 1.0.818be9091
Merge pull request #354 from dtolnay/deadcodea2eb7dd
Make compatible with -DwarningsUpdates
thiserror
from 1.0.57 to 1.0.58Release notes
Sourced from thiserror's releases.
Commits
df8bffa
Release 1.0.5814be209
Merge pull request #292 from dtolnay/deadcode15a1d64
Make compatible with -Dwarningsf55a5d2
Ignore mixed_attributes_style clippy lintf770921
Resolve assigning_clones clippy lintUpdates
diesel
from 2.1.4 to 2.1.5Changelog
Sourced from diesel's changelog.
Commits
c96c870
Merge pull request #3959 from 1Dragoon/backports/2.1.42c9f46d
Rustfmt67cac15
Another clippy fixc4ae62a
Fix the changelog links151d32e
Bump libsqlite3-sys to 0.289117d29
Fix the minimal version buildddc50de
Bump toolchain to 1.76.0bc2b4ab
Prerpare a 2.1.5 release23cf90e
Fixed test feature call lint, fixed test script, fixed flakey unit testf8d6fe0
Fix a bunch of new warningsUpdates
reqwest
from 0.11.24 to 0.12.2Release notes
Sourced from reqwest's releases.
... (truncated)
Changelog
Sourced from reqwest's changelog.
Commits
6768a8e
v0.12.2fff307b
fix(connect): ALPN missed when using socks5 proxy with rustls backend (#2164)04bf45f
fix: tls version limit for rustls (#2203)056f8c4
fix(connect): not negotiate h2 when using native-tls backend (#2165)e0ea15b
v0.12.13d78fcb
fix: Display for Error shouldn't include source (#2199)c535724
Fix binding interface when no TLS is used (#2200)d5adcba
fix: rustls extraction ofTlsInfo::peer_certificate()
being truncated (#2195)7a5df21
fix: could panic if http2 disabled but TLS negotiated h2 (#2194)d5051f9
Update version number in ReadmeDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show