Skip to content

Commit 96ec314

Browse files
committed
fix(cli): configure features for python
1 parent 55d5f6d commit 96ec314

File tree

7 files changed

+32
-24
lines changed

7 files changed

+32
-24
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- "-p stac-async"
3131
- "-p stac-cli --no-default-features"
3232
- "-p stac-cli --no-default-features -F geoparquet"
33-
- "-p stac-duckdb -F duckdb/bundled"
33+
- "-p stac-duckdb -F bundled"
3434
- "-p stac-server"
3535
- "-p stac-server -F axum"
3636
- "-p stac-validate"
@@ -50,7 +50,7 @@ jobs:
5050
sudo apt-get update
5151
sudo apt-get install libgdal-dev
5252
- name: Test
53-
run: cargo test -p stac -p stac-cli # gdal is default for stac-cli
53+
run: cargo test -p stac -p stac-cli --all-features
5454
test-ubuntu-with-pgstac:
5555
runs-on: ubuntu-latest
5656
services:
@@ -102,6 +102,22 @@ jobs:
102102
run: ruff check python && ruff format --check python && mypy python
103103
- name: Test
104104
run: pytest python/tests
105+
test-python-cli:
106+
runs-on: ubuntu-latest
107+
steps:
108+
- uses: actions/checkout@v4
109+
- uses: Swatinem/rust-cache@v2
110+
- uses: actions/setup-python@v5
111+
with:
112+
python-version: 3.x
113+
- name: Install dev requirements
114+
run: pip install maturin
115+
- name: Build
116+
run: maturin build --manifest-path cli/Cargo.toml --out dist
117+
- name: Install stacrs-cli
118+
run: pip install stacrs-cli --find-links dist --no-index
119+
- name: Smoke test
120+
run: stacrs --version
105121
check:
106122
runs-on: ubuntu-latest
107123
steps:

Cargo.toml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,4 @@ members = [
1111
"server",
1212
"validate",
1313
]
14-
default-members = [
15-
"api",
16-
"async",
17-
"cli",
18-
"core",
19-
"python",
20-
"server",
21-
"validate",
22-
]
14+
default-members = ["api", "async", "cli", "core", "server", "validate"]

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ duckdb = ["dep:stac-duckdb"]
1616
gdal = ["stac/gdal"]
1717
geoparquet = ["dep:bytes", "stac/geoparquet-compression"]
1818
pgstac = ["stac-server/pgstac"]
19-
python = ["dep:pyo3"]
19+
python = ["dep:pyo3", "pgstac", "duckdb", "stac-duckdb/bundled", "geoparquet"]
2020

2121
[dependencies]
2222
axum = "0.7"

cli/README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,29 @@
66
![Crates.io](https://img.shields.io/crates/l/stac-cli?style=for-the-badge)
77
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=for-the-badge)](./CODE_OF_CONDUCT)
88

9-
Command Line Interface (CLI), named `stacrs` for [STAC](https://stacspec.org/) built with [stac-rs](https://github.com/stac-utils/stac-rs).
10-
11-
![stac-cli gif](./img/stac-cli.gif)
9+
Command Line Interface (CLI) for [STAC](https://stacspec.org/), named `stacrs`.
1210

1311
## Installation
1412

15-
Install rust, e.g. with [rustup](https://rustup.rs/).
16-
Then:
17-
1813
```sh
1914
cargo install stac-cli
2015
```
2116

22-
You can also install it from PyPI, where it is named **stacrs**:
17+
Or:
2318

2419
```shell
25-
pip install stacrs
20+
pip install stacrs-cli
2621
```
2722

28-
### Homebrew
29-
30-
If you use [homebrew](https://brew.sh/), you can use [gadomski's](https://github.com/gadomski/) tap to install:
23+
Then:
3124

3225
```shell
33-
brew install gadomski/gadomski/stac
26+
stacrs --help
3427
```
3528

29+
**NOTE:** the version from PyPI (installed with `pip`) does not include GDAL support.
30+
If you need to use [gdal](../core/README.md#gdal) features, install via `cargo install`.
31+
3632
## Usage
3733

3834
**stacrs** provides the following subcommands:

cli/img/stac-cli.gif

-245 KB
Binary file not shown.

cli/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ Issues = "https://github.com/stac-utils/stac-rs/issues"
2929
stacrs = "stacrs_cli:main"
3030

3131
[tool.maturin]
32+
no-default-features = true
3233
features = ["pyo3/extension-module", "python"]
3334
module-name = "stacrs_cli"

duckdb/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name = "stac-duckdb"
33
version = "0.1.0"
44
edition = "2021"
55

6+
[features]
7+
bundled = ["duckdb/bundled"]
8+
69
[dependencies]
710
arrow = "52"
811
duckdb = "1"

0 commit comments

Comments
 (0)