diff --git a/CHANGELOG.md b/CHANGELOG.md index eb83ce3..0f58233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +## [0.7.0-beta.0] - 2025-04-23 + ### Added - Source distribution to PyPI publish ([#92](https://github.com/stac-utils/rustac-py/pull/92)) @@ -195,7 +197,8 @@ Non-functional release to fix releasing from Github actions. Initial release. -[Unreleased]: https://github.com/stac-utils/rustac-py/compare/v0.6.0...main +[Unreleased]: https://github.com/stac-utils/rustac-py/compare/v0.7.0-beta.0...main +[0.7.0-beta.0]: https://github.com/stac-utils/rustac-py/compare/v0.6.0...v0.7.0-beta.0 [0.6.0]: https://github.com/stac-utils/rustac-py/compare/v0.5.9...v0.6.0 [0.5.9]: https://github.com/stac-utils/rustac-py/compare/v0.5.8...v0.5.9 [0.5.8]: https://github.com/stac-utils/rustac-py/compare/v0.5.7...v0.5.8 diff --git a/Cargo.lock b/Cargo.lock index 858bbed..a6cd73e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3393,7 +3393,7 @@ dependencies = [ [[package]] name = "rustac-py" -version = "0.6.0" +version = "0.7.0-beta.0" dependencies = [ "cargo-lock", "clap", diff --git a/Cargo.toml b/Cargo.toml index 0cf0f5a..3b4404f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustac-py" -version = "0.6.0" +version = "0.7.0-beta.0" edition = "2024" publish = false diff --git a/scripts/format b/scripts/format index bd717b3..84c5bd9 100755 --- a/scripts/format +++ b/scripts/format @@ -2,5 +2,6 @@ set -e +cargo fmt uv run ruff check --fix uv run ruff format diff --git a/scripts/lint b/scripts/lint index 5dbb053..d413aaa 100755 --- a/scripts/lint +++ b/scripts/lint @@ -2,6 +2,7 @@ set -e +cargo fmt --check uv run ruff check uv run ruff format --check uv run mypy diff --git a/src/arrow.rs b/src/arrow.rs index 2b70357..993fc42 100644 --- a/src/arrow.rs +++ b/src/arrow.rs @@ -1,5 +1,5 @@ use crate::{Error, Json, Result}; -use pyo3::{prelude::*, IntoPyObjectExt}; +use pyo3::{IntoPyObjectExt, prelude::*}; use pyo3_arrow::PyTable; use serde_json::Value; use stac::geoarrow::Table; diff --git a/src/cli.rs b/src/cli.rs index e530170..ff14b97 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,8 +1,7 @@ use clap::Parser; use pyo3::{ - pyfunction, + PyResult, Python, pyfunction, types::{PyAnyMethods, PyDict}, - PyResult, Python, }; use rustac::Rustac; use tracing::Level; diff --git a/src/duckdb.rs b/src/duckdb.rs index 39f0685..02a3b62 100644 --- a/src/duckdb.rs +++ b/src/duckdb.rs @@ -1,13 +1,13 @@ use crate::{ - search::{PySortby, StringOrDict, StringOrList}, Result, + search::{PySortby, StringOrDict, StringOrList}, }; use duckdb::Connection; use pyo3::{ + IntoPyObjectExt, exceptions::PyException, prelude::*, types::{PyDict, PyList}, - IntoPyObjectExt, }; use pyo3_arrow::PyTable; use stac_duckdb::Client; diff --git a/src/error.rs b/src/error.rs index a7d8ec0..37789fc 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,7 +1,6 @@ use pyo3::{ - create_exception, + PyErr, create_exception, exceptions::{PyException, PyIOError}, - PyErr, }; use thiserror::Error; diff --git a/src/read.rs b/src/read.rs index c6bce66..9e20da2 100644 --- a/src/read.rs +++ b/src/read.rs @@ -1,5 +1,5 @@ use crate::{Error, Json}; -use pyo3::{pyfunction, types::PyAny, Bound, PyResult, Python}; +use pyo3::{Bound, PyResult, Python, pyfunction, types::PyAny}; use stac::{Format, Link, Links, SelfHref, Value}; #[pyfunction] diff --git a/src/search.rs b/src/search.rs index af8a3d9..3ca5783 100644 --- a/src/search.rs +++ b/src/search.rs @@ -1,7 +1,7 @@ use crate::{Error, Json, Result}; use geojson::Geometry; use pyo3::prelude::*; -use pyo3::{exceptions::PyValueError, types::PyDict, Bound, FromPyObject, PyErr, PyResult}; +use pyo3::{Bound, FromPyObject, PyErr, PyResult, exceptions::PyValueError, types::PyDict}; use stac::Bbox; use stac::Format; use stac_api::{Fields, Filter, Items, Search, Sortby}; diff --git a/src/walk.rs b/src/walk.rs index 9375ab5..5e0d1ff 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -1,7 +1,7 @@ use crate::{Error, Json, Result}; use pyo3::{ - exceptions::PyStopAsyncIteration, pyclass, pyfunction, pymethods, types::PyDict, Bound, Py, - PyAny, PyResult, Python, + Bound, Py, PyAny, PyResult, Python, exceptions::PyStopAsyncIteration, pyclass, pyfunction, + pymethods, types::PyDict, }; use stac::{Container, Item, Links, Node, SelfHref, Value}; use std::collections::VecDeque; @@ -40,16 +40,17 @@ type WalkStep = (Value, Vec, VecDeque); async fn next_walk(nodes: Arc>>) -> PyResult> { let mut nodes = nodes.lock().await; - match nodes.pop_front() { Some(node) => { - let mut node = node.resolve().await.map_err(Error::from)?; - let items = std::mem::take(&mut node.items); - let mut children = Vec::with_capacity(node.children.len()); - for child in node.children { - children.push(child.value.clone()); - nodes.push_back(child); + match nodes.pop_front() { + Some(node) => { + let mut node = node.resolve().await.map_err(Error::from)?; + let items = std::mem::take(&mut node.items); + let mut children = Vec::with_capacity(node.children.len()); + for child in node.children { + children.push(child.value.clone()); + nodes.push_back(child); + } + Ok(Json((node.value.into(), children, items))) } - Ok(Json((node.value.into(), children, items))) - } _ => { - Err(PyStopAsyncIteration::new_err("done walking")) - }} + _ => Err(PyStopAsyncIteration::new_err("done walking")), + } } diff --git a/src/write.rs b/src/write.rs index 234f35f..33bbab6 100644 --- a/src/write.rs +++ b/src/write.rs @@ -1,5 +1,5 @@ use crate::{Error, Json, Result}; -use pyo3::{pyfunction, Bound, PyAny, PyResult, Python}; +use pyo3::{Bound, PyAny, PyResult, Python, pyfunction}; use serde_json::Value; use stac::{Format, Item, ItemCollection};