ril-py
ril-py copied to clipboard
Update pyo3 requirement from 0.17 to 0.18
Updates the requirements on pyo3 to permit the latest version.
Release notes
Sourced from pyo3's releases.
PyO3 0.18.0
This release contains a number of new features for PyO3's macros which should make maintaining PyO3 projects easier.
#[pyfunction]
and#[pymethods]
have a new#[pyo3(signature = (...))]
option which allows specifying the Python signature. This replaces the#[args]
option already present for#[pymethods]
; the new option is better-validated and offers a syntax much more intuitive to users familiar with writing pure-Python functions.
#[pyclass]
has newget_all
andset_all
options for cases where all fields of a type should be readable or writable from Python.The
#[pyo3(text_signature = "...")]
option is now autogenerated for all functions created with#[pyfunction]
and#[pymethods]
. It can still be applied manually when it is necessary to override the generated form.As well as the macro API improvements, some other notable changes include:
PySet::new
andPyFrozenSet::new
now accept Rust iterators rather than requiring a slice.- Rust types have been added for all Python's built-in
Warning
types.- Non-zero integer types in
std::num
now have a conversion to/from Pythonint
.- The deprecated
#[pyproto]
attribute is now removed.There have been numerous other smaller improvements, changes and fixes. For full details see the CHANGELOG.
Please consult the migration guide for help upgrading.
Thank you to everyone who contributed code, documentation, design ideas, bug reports, and feedback. The following users' commits are included in this release:
@a1phyr
@adamreichold
@AdilZouitine
@alex
@birkenfeld
@CLOVIS-AI
@ctb
@dalcde
@datapythonista
@davidhewitt
@dylanbstorey
@flickpp
@gnaaman-dn
@haixuanTao
@hauntsaninja
@ijl
@itamarst
@jqnatividad
@matthewlloyd
@mejrs
@messense
@mrob95
@ongchi
@Oppen
@prehner
@Psykopear
@qbx2
@ryanrussell
@saethlin
... (truncated)
Changelog
Sourced from pyo3's changelog.
[0.18.0] - 2023-01-17
Packaging
- Relax
indexmap
optional depecency to allow>= 1.6, < 2
. [#2849](PyO3/pyo3#2849- Relax
hashbrown
optional dependency to allow>= 0.9, < 0.14
. #2875- Update
memoffset
dependency to 0.8. #2875Added
- Add
GILOnceCell::get_or_try_init
for fallibleGILOnceCell
initialization. #2398- Add experimental feature
experimental-inspect
withtype_input()
andtype_output()
helpers to get the Python type of any Python-compatible object. #2490 #2882- The
#[pyclass]
macro can now takeget_all
andset_all
to create getters and setters for every field. #2692- Add
#[pyo3(signature = (...))]
option for#[pyfunction]
and#[pymethods]
. #2702pyo3-build-config
: rebuild whenPYO3_ENVIRONMENT_SIGNATURE
environment variable value changes. #2727- Add conversions between non-zero int types in
std::num
and Pythonint
. #2730- Add
Py::downcast()
as a companion toPyAny::downcast()
, as well asdowncast_unchecked()
for both types. #2734- Add types for all built-in
Warning
classes as well asPyErr::warn_explicit
. #2742- Add
abi3-py311
feature. #2776- Add FFI definition
_PyErr_ChainExceptions()
for CPython. #2788- Add FFI definitions
PyVectorcall_NARGS
andPY_VECTORCALL_ARGUMENTS_OFFSET
for PyPy 3.8 and up. #2811- Add
PyList::get_item_unchecked
for PyPy. #2827Changed
- PyO3's macros now emit a much nicer error message if function return values don't implement the required trait(s). #2664
- Use a TypeError, rather than a ValueError, when refusing to treat a str as a Vec. #2685
- Change
PyCFunction::new_closure
to takename
anddoc
arguments. #2686PyType::is_subclass
,PyErr::is_instance
andPyAny::is_instance
now take&PyAny
instead of&PyType
arguments, so that they work with objects that pretend to be types using__subclasscheck__
and__instancecheck__
. #2695- Deprecate
#[args]
attribute and passing "args" specification directly to#[pyfunction]
in favor of the new#[pyo3(signature = (...))]
option. #2702- Deprecate required arguments after
Option<T>
arguments to#[pyfunction]
and#[pymethods]
without also using#[pyo3(signature)]
to specify whether the arguments should be required or have defaults. #2703- Change
#[pyfunction]
and#[pymethods]
to use a common call "trampoline" to slightly reduce generated code size and compile times. #2705PyAny::cast_as()
andPy::cast_as()
are now deprecated in favor ofPyAny::downcast()
and the newPy::downcast()
. #2734- Relax lifetime bounds on
PyAny::downcast()
. #2734- Automatically generate
__text_signature__
for all Python functions created using#[pyfunction]
and#[pymethods]
. #2784- Accept any iterator in
PySet::new
andPyFrozenSet::new
. #2795- Mixing
#[cfg(...)]
and#[pyo3(...)]
attributes on#[pyclass]
struct fields will now work. #2796- Re-enable
PyFunction
on when building for abi3 or PyPy. #2838- Improve
derive(FromPyObject)
to useintern!
when applicable for#[pyo3(item)]
. #2838Removed
- Remove the deprecated
pyproto
feature,#[pyproto]
macro, and all accompanying APIs. #2587- Remove all functionality deprecated in PyO3 0.16. #2843
Fixed
... (truncated)
Commits
224a416
release: 0.18.0ca1bbe3
add migration notes for PyO3 0.1872c561c
Merge #2882713f51a
Merge #28798026f35
Improve derive(FromPyObject) to apply intern! when applicable20ca3be
inspect: gate behindexperimental-inspect
feature556b3cf
Merge #27038f48d15
deprecate required arguments after option arguments without signatureed0f338
Merge #2875a7a9dae
Add a changelog entry for[#2875](https://github.com/pyo3/pyo3/issues/2875)
- Additional commits viewable in compare view
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 ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)