diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afa6374c..03a094a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,8 @@ jobs: - "-p stac-async" - "-p stac-cli --no-default-features" - "-p stac-cli --no-default-features -F geoparquet" - - "-p stac-duckdb -F duckdb/bundled" + - "-p stac-cli --no-default-features -F python" + - "-p stac-duckdb -F bundled" - "-p stac-server" - "-p stac-server -F axum" - "-p stac-validate" @@ -50,7 +51,7 @@ jobs: sudo apt-get update sudo apt-get install libgdal-dev - name: Test - run: cargo test -p stac -p stac-cli # gdal is default for stac-cli + run: cargo test -p stac -p stac-cli --all-features test-ubuntu-with-pgstac: runs-on: ubuntu-latest services: @@ -102,6 +103,22 @@ jobs: run: ruff check python && ruff format --check python && mypy python - name: Test run: pytest python/tests + test-python-cli: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Install dev requirements + run: pip install maturin + - name: Build + run: maturin build --manifest-path cli/Cargo.toml --out dist + - name: Install stacrs-cli + run: pip install stacrs-cli --find-links dist --no-index + - name: Smoke test + run: stacrs --version check: runs-on: ubuntu-latest steps: diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1b5e5f1c..7081010d 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -16,7 +16,7 @@ duckdb = ["dep:stac-duckdb"] gdal = ["stac/gdal"] geoparquet = ["dep:bytes", "stac/geoparquet-compression"] pgstac = ["stac-server/pgstac"] -python = ["dep:pyo3"] +python = ["dep:pyo3", "pgstac", "stac-duckdb/bundled", "geoparquet"] [dependencies] axum = "0.7" diff --git a/cli/README.md b/cli/README.md index 148aff4a..3f156afe 100644 --- a/cli/README.md +++ b/cli/README.md @@ -6,33 +6,29 @@ ![Crates.io](https://img.shields.io/crates/l/stac-cli?style=for-the-badge) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=for-the-badge)](./CODE_OF_CONDUCT) -Command Line Interface (CLI), named `stacrs` for [STAC](https://stacspec.org/) built with [stac-rs](https://github.com/stac-utils/stac-rs). - -![stac-cli gif](./img/stac-cli.gif) +Command Line Interface (CLI) for [STAC](https://stacspec.org/), named `stacrs`. ## Installation -Install rust, e.g. with [rustup](https://rustup.rs/). -Then: - ```sh cargo install stac-cli ``` -You can also install it from PyPI, where it is named **stacrs**: +Or: ```shell -pip install stacrs +pip install stacrs-cli ``` -### Homebrew - -If you use [homebrew](https://brew.sh/), you can use [gadomski's](https://github.com/gadomski/) tap to install: +Then: ```shell -brew install gadomski/gadomski/stac +stacrs --help ``` +**NOTE:** the version from PyPI (installed with `pip`) does not include GDAL support. +If you need to use [gdal](../core/README.md#gdal) features, install via `cargo install`. + ## Usage **stacrs** provides the following subcommands: diff --git a/cli/img/stac-cli.gif b/cli/img/stac-cli.gif deleted file mode 100644 index 8cbaf11a..00000000 Binary files a/cli/img/stac-cli.gif and /dev/null differ diff --git a/cli/pyproject.toml b/cli/pyproject.toml index 29c9d5a3..479cff2e 100644 --- a/cli/pyproject.toml +++ b/cli/pyproject.toml @@ -29,5 +29,6 @@ Issues = "https://github.com/stac-utils/stac-rs/issues" stacrs = "stacrs_cli:main" [tool.maturin] +no-default-features = true features = ["pyo3/extension-module", "python"] module-name = "stacrs_cli" diff --git a/duckdb/Cargo.toml b/duckdb/Cargo.toml index dc5f0b80..b31dea6b 100644 --- a/duckdb/Cargo.toml +++ b/duckdb/Cargo.toml @@ -3,6 +3,9 @@ name = "stac-duckdb" version = "0.1.0" edition = "2021" +[features] +bundled = ["duckdb/bundled"] + [dependencies] arrow = "52" duckdb = "1"