Skip to content

Commit

Permalink
Merge branch 'main' into issues/195-python
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Apr 8, 2024
2 parents 6576c1d + c5507e5 commit 0069dce
Show file tree
Hide file tree
Showing 25 changed files with 812 additions and 79 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
tar czvf $ARCHIVE_FILE -C target/release stac
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: binaries
path: |
Expand All @@ -38,11 +38,11 @@ jobs:
- x84_64-apple-darwin
if: "startsWith(github.ref, 'refs/tags/stac-cli')"
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: binaries
path: binaries
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: binaries/*
7 changes: 4 additions & 3 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
4. Update the package's `Cargo.toml` file accordingly, and update the other packages' `Cargo.toml` if they depend on this package.
5. Scan the package's README for references to version numbers, and update any that are needed.
6. Update the package's CHANGELOG with a new section for the new version. Don't forget to update the links at the bottom, too.
7. Test the release with `cargo release -p {package name}`. By default, this does a dry-run, so it won't actually do anything.
8. Use the normal pull request workflow to merge your branch.
9. Once merged, run `cargo release --execute` to do the release. Use the same `-p` flags as you did during the dry run.
7. If it's a breaking release, search for any deprecated functions that should be removed.
8. Test the release with `cargo release -p {package name}`. By default, this does a dry-run, so it won't actually do anything.
9. Use the normal pull request workflow to merge your branch.
10. Once merged, run `cargo release --execute` to do the release. Use the same `-p` flags as you did during the dry run.

## After-the-fact releases

Expand Down
10 changes: 9 additions & 1 deletion stac-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [0.3.3] - 2024-04-07

### Added

- `Search::validate` ([#206](https://github.com/stac-utils/stac-rs/pull/206))
- `geo` feature, `Search::matches` and sub-methods, `Search::new`, `Search::ids`, `Default` for `Filter`, `Error::Stac`, and `Error::Unimplemented` ([#209](https://github.com/stac-utils/stac-rs/pull/209))

## [0.3.2] - 2023-10-11

### Added
Expand Down Expand Up @@ -71,7 +78,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

Initial release

[unreleased]: https://github.com/stac-utils/stac-rs/compare/stac-api-v0.3.2...main
[unreleased]: https://github.com/stac-utils/stac-rs/compare/stac-api-v0.3.3...main
[0.3.3]: https://github.com/stac-utils/stac-rs/compare/stac-api-v0.3.2...stac-api-v0.3.3
[0.3.2]: https://github.com/stac-utils/stac-rs/compare/stac-api-v0.3.1...stac-api-v0.3.2
[0.3.1]: https://github.com/stac-utils/stac-rs/compare/stac-api-v0.3.0...stac-api-v0.3.1
[0.3.0]: https://github.com/stac-utils/stac-rs/compare/stac-api-v0.2.0...stac-api-v0.3.0
Expand Down
7 changes: 6 additions & 1 deletion stac-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stac-api"
version = "0.3.2"
version = "0.3.3"
authors = ["Pete Gadomski <[email protected]>"]
edition = "2021"
description = "Rust library for the SpatioTemporal Asset Catalog (STAC) API specification"
Expand All @@ -11,13 +11,18 @@ keywords = ["geospatial", "stac", "metadata", "geo", "raster"]
categories = ["science", "data-structures", "web-programming"]

[features]
geo = ["dep:geo", "stac/geo"]
schemars = ["dep:schemars", "stac/schemars"]

[dependencies]
geo = { version = "0.28", optional = true }
schemars = { version = "0.8", optional = true }
serde = "1"
serde_json = "1"
serde_urlencoded = "0.7"
stac = { version = "0.5", path = "../stac" }
thiserror = "1"
url = "2.3"

[dev-dependencies]
geojson = "0.24"
10 changes: 9 additions & 1 deletion stac-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ To use the library in your project:
stac-api = "0.3"
```

**stac-api** has one optional feature, `schemars`, which can be used to generate [jsonschema](https://json-schema.org/) documents for the API structures.
**stac-api** has two optional features.
`geo` enables `Search::match`:

```toml
[dependencies]
stac-api = { version = "0.3", features = ["geo"] }
```

`schemars`, can be used to generate [jsonschema](https://json-schema.org/) documents for the API structures.
This is useful for auto-generating OpenAPI documentation:

```toml
Expand Down
13 changes: 13 additions & 0 deletions stac-api/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::Search;
use serde_json::{Map, Value};
use thiserror::Error;

Expand All @@ -23,6 +24,10 @@ pub enum Error {
#[error(transparent)]
ParseFloatError(#[from] std::num::ParseFloatError),

/// A search has both bbox and intersects.
#[error("search has bbox and intersects")]
SearchHasBboxAndIntersects(Search),

/// [serde_json::Error]
#[error(transparent)]
SerdeJson(#[from] serde_json::Error),
Expand All @@ -31,11 +36,19 @@ pub enum Error {
#[error(transparent)]
SerdeUrlencodedSer(#[from] serde_urlencoded::ser::Error),

/// [stac::Error]
#[error(transparent)]
Stac(#[from] stac::Error),

/// [std::num::TryFromIntError]
#[error(transparent)]
TryFromInt(#[from] std::num::TryFromIntError),

/// [url::ParseError]
#[error(transparent)]
UrlParse(#[from] url::ParseError),

/// This functionality is not yet implemented.
#[error("this functionality is not yet implemented: {0}")]
Unimplemented(&'static str),
}
6 changes: 6 additions & 0 deletions stac-api/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ pub enum Filter {
Cql2Json(Map<String, Value>),
}

impl Default for Filter {
fn default() -> Self {
Filter::Cql2Json(Default::default())
}
}

#[cfg(test)]
mod tests {
use super::Filter;
Expand Down
3 changes: 3 additions & 0 deletions stac-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ pub type Result<T> = std::result::Result<T, Error>;
/// servers to explicitly include or exclude certain fields.
pub type Item = serde_json::Map<String, serde_json::Value>;

#[cfg(test)]
use geojson as _;

// From https://github.com/rust-lang/cargo/issues/383#issuecomment-720873790,
// may they be forever blessed.
#[cfg(doctest)]
Expand Down
Loading

0 comments on commit 0069dce

Please sign in to comment.