Skip to content

Commit 49eb346

Browse files
ngoldbaumdependabot[bot]amyreese
authored andcommitted
update pyo3 to 0.25 (Instagram#1324)
* build(deps): bump pyo3 from 0.23.5 to 0.25.0 in /native Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.23.5 to 0.25.0. - [Release notes](https://github.com/pyo3/pyo3/releases) - [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md) - [Commits](PyO3/pyo3@v0.23.5...v0.25.0) --- updated-dependencies: - dependency-name: pyo3 dependency-version: 0.25.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * update pyo3 to 0.24 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Amethyst Reese <amethyst@n7.gg>
1 parent 654186c commit 49eb346

4 files changed

Lines changed: 19 additions & 19 deletions

File tree

‎native/Cargo.lock‎

Lines changed: 12 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎native/libcst/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ trace = ["peg/trace"]
3636

3737
[dependencies]
3838
paste = "1.0.15"
39-
pyo3 = { version = "0.23", optional = true }
39+
pyo3 = { version = "0.25", optional = true }
4040
thiserror = "1.0.63"
4141
peg = "0.8.4"
4242
annotate-snippets = "0.11.5"

‎native/libcst/src/nodes/parser_config.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ fn parser_config_asdict<'py>(py: Python<'py>, config: PyRef<'py, ParserConfig>)
125125
("version", config.version.clone_ref(py)),
126126
("future_imports", config.future_imports.clone_ref(py)),
127127
]
128-
.into_py_dict_bound(py)
128+
.into_py_dict(py)
129+
.unwrap()
129130
}
130131

131132
pub fn init_module(_py: Python, m: &PyModule) -> PyResult<()> {

‎native/libcst_derive/src/into_py.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn impl_into_py_enum(ast: &DeriveInput, e: &DataEnum) -> TokenStream {
4040
Self::#varname { #(#fieldnames,)* .. } => {
4141
use pyo3::types::PyAnyMethods;
4242

43-
let libcst = pyo3::types::PyModule::import_bound(py, "libcst")?;
43+
let libcst = pyo3::types::PyModule::import(py, "libcst")?;
4444
let kwargs = #kwargs_toks ;
4545
Ok(libcst
4646
.getattr(stringify!(#varname))
@@ -90,7 +90,7 @@ fn impl_into_py_struct(ast: &DeriveInput, e: &DataStruct) -> TokenStream {
9090
impl#generics crate::nodes::traits::py::TryIntoPy<pyo3::PyObject> for #ident #generics {
9191
fn try_into_py(self, py: pyo3::Python) -> pyo3::PyResult<pyo3::PyObject> {
9292
use pyo3::types::PyAnyMethods;
93-
let libcst = pyo3::types::PyModule::import_bound(py, "libcst")?;
93+
let libcst = pyo3::types::PyModule::import(py, "libcst")?;
9494
let kwargs = #kwargs_toks ;
9595
Ok(libcst
9696
.getattr(stringify!(#ident))
@@ -165,15 +165,15 @@ fn fields_to_kwargs(fields: &Fields, is_enum: bool) -> quote::__private::TokenSt
165165
#(#optional_rust_varnames.map(|x| x.try_into_py(py)).transpose()?.map(|x| (stringify!(#optional_py_varnames), x)),)*
166166
};
167167
if empty_kwargs {
168-
quote! { pyo3::types::PyDict::new_bound(py) }
168+
quote! { pyo3::types::PyDict::new(py) }
169169
} else {
170170
quote! {
171171
[ #kwargs_pairs #optional_pairs ]
172172
.iter()
173173
.filter(|x| x.is_some())
174174
.map(|x| x.as_ref().unwrap())
175175
.collect::<Vec<_>>()
176-
.into_py_dict_bound(py)
176+
.into_py_dict(py)?
177177
}
178178
}
179179
}

0 commit comments

Comments
 (0)