Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustac-py"
version = "0.6.0"
version = "0.7.0-beta.0"
edition = "2024"
publish = false

Expand Down
1 change: 1 addition & 0 deletions scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

set -e

cargo fmt
uv run ruff check --fix
uv run ruff format
1 change: 1 addition & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -e

cargo fmt --check
uv run ruff check
uv run ruff format --check
uv run mypy
2 changes: 1 addition & 1 deletion src/arrow.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use clap::Parser;
use pyo3::{
pyfunction,
PyResult, Python, pyfunction,
types::{PyAnyMethods, PyDict},
PyResult, Python,
};
use rustac::Rustac;
use tracing::Level;
Expand Down
4 changes: 2 additions & 2 deletions src/duckdb.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use pyo3::{
create_exception,
PyErr, create_exception,
exceptions::{PyException, PyIOError},
PyErr,
};
use thiserror::Error;

Expand Down
2 changes: 1 addition & 1 deletion src/read.rs
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/search.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
27 changes: 14 additions & 13 deletions src/walk.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -40,16 +40,17 @@ type WalkStep = (Value, Vec<Container>, VecDeque<Item>);

async fn next_walk(nodes: Arc<Mutex<VecDeque<Node>>>) -> PyResult<Json<WalkStep>> {
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")),
}
}
2 changes: 1 addition & 1 deletion src/write.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
Loading