Skip to content

Commit

Permalink
chore(deps): bump pyo3 to 0.21.0 and pyo3-log (#645)
Browse files Browse the repository at this point in the history
* chore(deps): bump `pyo3` to 0.21.2 and `pyo3-log`

* chore: move out of deprecated `pyo3` APIs
  • Loading branch information
mkniewallner committed Apr 21, 2024
1 parent 33f762d commit bc26a6f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ encoding_rs = "0.8.34"
ignore = "0.4.22"
log = "0.4.21"
path-slash = "0.2.1"
pyo3 = { version = "0.20.3", features = ["abi3-py38"] }
pyo3-log = "0.9.0"
pyo3 = { version = "0.21.2", features = ["abi3-py38"] }
pyo3-log = "0.10.0"
rayon = "1.10.0"
regex = "1.10.4"
ruff_python_ast = { git = "https://github.com/astral-sh/ruff", tag = "v0.4.1" }
Expand Down
4 changes: 2 additions & 2 deletions src/imports/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ pub fn convert_to_python_dict(
py: Python<'_>,
imports_with_locations: FileToImportsMap,
) -> PyResult<PyObject> {
let imports_dict = PyDict::new(py);
let imports_dict = PyDict::new_bound(py);

for (module, locations) in imports_with_locations {
let py_locations: Vec<PyObject> = locations
.into_iter()
.map(|location| location.into_py(py))
.collect();
let locations_list = PyList::new(py, &py_locations);
let locations_list = PyList::new_bound(py, &py_locations);
imports_dict.set_item(module, locations_list)?;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod visitor;
use location::Location;

#[pymodule]
fn rust(_py: Python, m: &PyModule) -> PyResult<()> {
fn rust(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
pyo3_log::init(); // Initialize logging to forward to Python's logger

m.add_function(wrap_pyfunction!(imports::py::get_imports_from_py_files, m)?)?;
Expand Down
8 changes: 4 additions & 4 deletions src/python_file_finder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use std::path::PathBuf;
pub fn find_python_files(
py: Python,
directories: Vec<PathBuf>,
exclude: Vec<&str>,
extend_exclude: Vec<&str>,
exclude: Vec<String>,
extend_exclude: Vec<String>,
using_default_exclude: bool,
ignore_notebooks: bool,
) -> PyResult<PyObject> {
Expand All @@ -37,12 +37,12 @@ pub fn find_python_files(
})
.collect();

Ok(PyList::new(py, &python_files).into())
Ok(PyList::new_bound(py, &python_files).into())
}

fn build_walker(
directories: Vec<PathBuf>,
excluded_patterns: Vec<&str>,
excluded_patterns: Vec<String>,
use_git_ignore: bool,
ignore_notebooks: bool,
) -> Walk {
Expand Down

0 comments on commit bc26a6f

Please sign in to comment.