From 6b267fd06b80d43b7eb4426dc4a74a1a6d76b5ce Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 18 Feb 2025 14:42:15 -0500 Subject: [PATCH 01/18] fix: more cli flaling --- crates/cli/Cargo.toml | 2 +- crates/cli/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index e286d2f7..e639f84c 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "stac-cli" description = "Command line interface for stac-rs" -version = "0.5.1-rc.3" +version = "0.5.1-rc.4" keywords = ["geospatial", "stac", "metadata", "geo", "raster"] authors.workspace = true edition.workspace = true diff --git a/crates/cli/pyproject.toml b/crates/cli/pyproject.toml index de119f8e..7eb3d039 100644 --- a/crates/cli/pyproject.toml +++ b/crates/cli/pyproject.toml @@ -7,7 +7,7 @@ name = "stacrs-cli" description = "A STAC command-line interface written in Rust" readme = "README.md" authors = [{ name = "Pete Gadomski", email = "pete.gadomski@gmail.com" }] -requires-python = ">=3.10" +requires-python = ">=3.9" classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", From 09e4c01b042cfae0ce58872c07bde429e5f5b9f6 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 18 Feb 2025 14:47:12 -0500 Subject: [PATCH 02/18] fix: flail on, flailer --- .github/workflows/python-cli.yml | 33 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/python-cli.yml b/.github/workflows/python-cli.yml index c4561ba2..85ed3816 100644 --- a/.github/workflows/python-cli.yml +++ b/.github/workflows/python-cli.yml @@ -39,14 +39,14 @@ jobs: manylinux: auto steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.x + - uses: astral-sh/setup-uv@v5 + - name: Install Python versions + run: uv python install 3.9 - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --manifest-path crates/cli/Cargo.toml -F duckdb/bundled + args: --release --out dist -i 3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled sccache: "true" manylinux: ${{ matrix.platform.manylinux }} - name: Upload wheels @@ -70,14 +70,14 @@ jobs: target: armv7 steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.x + - uses: astral-sh/setup-uv@v5 + - name: Install Python versions + run: uv python install 3.9 - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --manifest-path crates/cli/Cargo.toml -F duckdb/bundled + args: --release --out dist -i 3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled sccache: "true" manylinux: musllinux_1_2 - name: Upload wheels @@ -97,15 +97,14 @@ jobs: target: x86 steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.x - architecture: ${{ matrix.platform.target }} + - uses: astral-sh/setup-uv@v5 + - name: Install Python versions + run: uv python install 3.9 - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --manifest-path crates/cli/Cargo.toml -F duckdb/bundled + args: --release --out dist -i 3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v4 @@ -124,14 +123,14 @@ jobs: target: aarch64 steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.x + - uses: astral-sh/setup-uv@v5 + - name: Install Python versions + run: uv python install 3.9 - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --manifest-path crates/cli/Cargo.toml -F duckdb/bundled + args: --release --out dist -i 3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v4 From 8804ec137d2f0365c7dc60261845d39cd11df09c Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 18 Feb 2025 14:55:28 -0500 Subject: [PATCH 03/18] fix: flail, flail, flail --- .github/workflows/python-cli.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/python-cli.yml b/.github/workflows/python-cli.yml index 85ed3816..54562720 100644 --- a/.github/workflows/python-cli.yml +++ b/.github/workflows/python-cli.yml @@ -39,14 +39,11 @@ jobs: manylinux: auto steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - - name: Install Python versions - run: uv python install 3.9 - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist -i 3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled + args: --release --out dist -i python3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled sccache: "true" manylinux: ${{ matrix.platform.manylinux }} - name: Upload wheels @@ -70,14 +67,11 @@ jobs: target: armv7 steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - - name: Install Python versions - run: uv python install 3.9 - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist -i 3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled + args: --release --out dist -i python3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled sccache: "true" manylinux: musllinux_1_2 - name: Upload wheels @@ -97,14 +91,11 @@ jobs: target: x86 steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - - name: Install Python versions - run: uv python install 3.9 - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist -i 3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled + args: --release --out dist -i python3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v4 @@ -123,14 +114,11 @@ jobs: target: aarch64 steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - - name: Install Python versions - run: uv python install 3.9 - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist -i 3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled + args: --release --out dist -i python3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v4 From 39eba6243f4a96cc5cb983548d1e6b0c78af6bec Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 18 Feb 2025 15:00:56 -0500 Subject: [PATCH 04/18] fix: another one --- .github/workflows/python-cli.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python-cli.yml b/.github/workflows/python-cli.yml index 54562720..2f073d11 100644 --- a/.github/workflows/python-cli.yml +++ b/.github/workflows/python-cli.yml @@ -39,6 +39,7 @@ jobs: manylinux: auto steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -67,6 +68,7 @@ jobs: target: armv7 steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -91,6 +93,7 @@ jobs: target: x86 steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -114,6 +117,7 @@ jobs: target: aarch64 steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 - name: Build wheels uses: PyO3/maturin-action@v1 with: From f2d29386b2aa6b038f931f97f9b165d0c61e146c Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 18 Feb 2025 15:26:09 -0500 Subject: [PATCH 05/18] fix: cffi --- crates/cli/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cli/pyproject.toml b/crates/cli/pyproject.toml index 7eb3d039..87fe9d34 100644 --- a/crates/cli/pyproject.toml +++ b/crates/cli/pyproject.toml @@ -20,7 +20,7 @@ classifiers = [ ] keywords = ["stac", "geospatial"] dynamic = ["version"] -dependencies = [] +dependencies = ["cffi"] [project.urls] Repository = "https://github.com/stac-utils/stac-rs" From 38c97ca042f619cefb09441498f1d3097337130f Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 18 Feb 2025 15:29:44 -0500 Subject: [PATCH 06/18] fix: set python on other stuff --- .github/workflows/python-cli.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/python-cli.yml b/.github/workflows/python-cli.yml index 2f073d11..22a476c8 100644 --- a/.github/workflows/python-cli.yml +++ b/.github/workflows/python-cli.yml @@ -69,6 +69,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + with: + python-version: "3.9" - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -94,6 +96,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + with: + python-version: "3.9" - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -118,6 +122,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + with: + python-version: "3.9" - name: Build wheels uses: PyO3/maturin-action@v1 with: From 7ce80e65ca643c03258dedfe72d2e03caae32d8d Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 18 Feb 2025 17:25:33 -0500 Subject: [PATCH 07/18] fix: more flail, 3.10 --- .github/workflows/python-cli.yml | 2 ++ crates/cli/Cargo.toml | 2 +- crates/cli/pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-cli.yml b/.github/workflows/python-cli.yml index 22a476c8..06b0b829 100644 --- a/.github/workflows/python-cli.yml +++ b/.github/workflows/python-cli.yml @@ -2,6 +2,8 @@ name: PyPI on: push: + branches: + - main tags: - "stac-cli-*" workflow_dispatch: diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index e639f84c..fc1b52cd 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -24,7 +24,7 @@ duckdb = { workspace = true, features = ["bundled"] } libduckdb-sys = { workspace = true } object_store.workspace = true pyo3 = { workspace = true, optional = true, features = [ - "abi3-py39", + "abi3-py310", "extension-module", ] } reqwest.workspace = true diff --git a/crates/cli/pyproject.toml b/crates/cli/pyproject.toml index 87fe9d34..d1766ec0 100644 --- a/crates/cli/pyproject.toml +++ b/crates/cli/pyproject.toml @@ -7,7 +7,7 @@ name = "stacrs-cli" description = "A STAC command-line interface written in Rust" readme = "README.md" authors = [{ name = "Pete Gadomski", email = "pete.gadomski@gmail.com" }] -requires-python = ">=3.9" +requires-python = ">=3.10" classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", From 3fa1d20f4a51d5387681a9c92d3a226b4d7705d6 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 18 Feb 2025 17:27:54 -0500 Subject: [PATCH 08/18] fix: try w/o extension modules --- crates/cli/Cargo.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index fc1b52cd..89b26d43 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -23,10 +23,7 @@ clap = { workspace = true, features = ["derive"] } duckdb = { workspace = true, features = ["bundled"] } libduckdb-sys = { workspace = true } object_store.workspace = true -pyo3 = { workspace = true, optional = true, features = [ - "abi3-py310", - "extension-module", -] } +pyo3 = { workspace = true, optional = true, features = ["abi3-py310"] } reqwest.workspace = true serde.workspace = true serde_json.workspace = true From 125a06f04009d955a69677fff8ce4179ba36326c Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 18 Feb 2025 17:30:36 -0500 Subject: [PATCH 09/18] fix: more flail --- .github/workflows/python-cli.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-cli.yml b/.github/workflows/python-cli.yml index 06b0b829..6dd73b25 100644 --- a/.github/workflows/python-cli.yml +++ b/.github/workflows/python-cli.yml @@ -42,11 +42,13 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + with: + python-version: "3.10" - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist -i python3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled + args: --release --out dist -i python3.10 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled sccache: "true" manylinux: ${{ matrix.platform.manylinux }} - name: Upload wheels @@ -72,12 +74,12 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.10" - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist -i python3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled + args: --release --out dist -i python3.10 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled sccache: "true" manylinux: musllinux_1_2 - name: Upload wheels @@ -99,12 +101,12 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.10" - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist -i python3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled + args: --release --out dist -i python3.10 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v4 @@ -125,12 +127,12 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.10" - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist -i python3.9 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled + args: --release --out dist -i python3.10 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v4 From 9b9e545bc1056012effaf2c60cfe0cc8a0156886 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 18 Feb 2025 17:45:31 -0500 Subject: [PATCH 10/18] fix: try 2_28 --- .github/workflows/python-cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-cli.yml b/.github/workflows/python-cli.yml index 6dd73b25..029f5d53 100644 --- a/.github/workflows/python-cli.yml +++ b/.github/workflows/python-cli.yml @@ -26,7 +26,7 @@ jobs: manylinux: auto - runner: ubuntu-22.04 target: x86 - manylinux: auto + manylinux: "2_28" - runner: ubuntu-22.04 target: aarch64 manylinux: "2_28" From 420fb07f180756b57ce3c762ac9653cd31232faf Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Wed, 19 Feb 2025 05:39:31 -0500 Subject: [PATCH 11/18] fix: switch back to auto for x84 manylinux --- .github/workflows/python-cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-cli.yml b/.github/workflows/python-cli.yml index 029f5d53..6dd73b25 100644 --- a/.github/workflows/python-cli.yml +++ b/.github/workflows/python-cli.yml @@ -26,7 +26,7 @@ jobs: manylinux: auto - runner: ubuntu-22.04 target: x86 - manylinux: "2_28" + manylinux: auto - runner: ubuntu-22.04 target: aarch64 manylinux: "2_28" From 3dd72f17341b37aa124ba378bc064f324f7e756f Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Wed, 19 Feb 2025 06:01:32 -0500 Subject: [PATCH 12/18] fix: try extension-module again --- crates/cli/pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/cli/pyproject.toml b/crates/cli/pyproject.toml index d1766ec0..f2a48c98 100644 --- a/crates/cli/pyproject.toml +++ b/crates/cli/pyproject.toml @@ -20,7 +20,6 @@ classifiers = [ ] keywords = ["stac", "geospatial"] dynamic = ["version"] -dependencies = ["cffi"] [project.urls] Repository = "https://github.com/stac-utils/stac-rs" @@ -31,5 +30,5 @@ stacrs = "stacrs_cli:main" [tool.maturin] no-default-features = true -features = ["python"] +features = ["python", "pyo3/extension-module"] module-name = "stacrs_cli" From 7a81ac35a7c653b8ec46f923e7206d2397c3b81a Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Wed, 19 Feb 2025 06:17:17 -0500 Subject: [PATCH 13/18] fix: add cffi dependency --- crates/cli/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/cli/pyproject.toml b/crates/cli/pyproject.toml index f2a48c98..7ad54537 100644 --- a/crates/cli/pyproject.toml +++ b/crates/cli/pyproject.toml @@ -20,6 +20,7 @@ classifiers = [ ] keywords = ["stac", "geospatial"] dynamic = ["version"] +dependencies = ["cffi==1.17.1"] [project.urls] Repository = "https://github.com/stac-utils/stac-rs" From 6b8104640fb326627c6ba16241d28bf14287a860 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Wed, 19 Feb 2025 06:28:56 -0500 Subject: [PATCH 14/18] fix: begone Moving it to stacrs: https://github.com/stac-utils/stacrs/pull/46 --- .github/workflows/python-cli.yml | 181 ------------------------------- README.md | 2 +- crates/cli/Cargo.toml | 2 - crates/cli/README.md | 7 -- crates/cli/pyproject.toml | 35 ------ crates/cli/release.toml | 1 - crates/cli/src/lib.rs | 3 - crates/cli/src/python.rs | 42 ------- docs/cli/index.md | 2 +- 9 files changed, 2 insertions(+), 273 deletions(-) delete mode 100644 .github/workflows/python-cli.yml delete mode 100644 crates/cli/pyproject.toml delete mode 100644 crates/cli/release.toml delete mode 100644 crates/cli/src/python.rs diff --git a/.github/workflows/python-cli.yml b/.github/workflows/python-cli.yml deleted file mode 100644 index 6dd73b25..00000000 --- a/.github/workflows/python-cli.yml +++ /dev/null @@ -1,181 +0,0 @@ -name: PyPI - -on: - push: - branches: - - main - tags: - - "stac-cli-*" - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - linux: - runs-on: ${{ matrix.platform.runner }} - strategy: - matrix: - platform: - - runner: ubuntu-22.04 - target: x86_64 - manylinux: auto - - runner: ubuntu-22.04 - target: x86 - manylinux: auto - - runner: ubuntu-22.04 - target: aarch64 - manylinux: "2_28" - - runner: ubuntu-22.04 - target: armv7 - manylinux: auto - - runner: ubuntu-22.04 - target: s390x - manylinux: auto - - runner: ubuntu-22.04 - target: ppc64le - manylinux: auto - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.platform.target }} - args: --release --out dist -i python3.10 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled - sccache: "true" - manylinux: ${{ matrix.platform.manylinux }} - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-linux-${{ matrix.platform.target }} - path: dist - - musllinux: - runs-on: ${{ matrix.platform.runner }} - strategy: - matrix: - platform: - - runner: ubuntu-22.04 - target: x86_64 - - runner: ubuntu-22.04 - target: x86 - - runner: ubuntu-22.04 - target: aarch64 - - runner: ubuntu-22.04 - target: armv7 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.platform.target }} - args: --release --out dist -i python3.10 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled - sccache: "true" - manylinux: musllinux_1_2 - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-musllinux-${{ matrix.platform.target }} - path: dist - - windows: - runs-on: ${{ matrix.platform.runner }} - strategy: - matrix: - platform: - - runner: windows-latest - target: x64 - - runner: windows-latest - target: x86 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.platform.target }} - args: --release --out dist -i python3.10 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled - sccache: "true" - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-windows-${{ matrix.platform.target }} - path: dist - - macos: - runs-on: ${{ matrix.platform.runner }} - strategy: - matrix: - platform: - - runner: macos-13 - target: x86_64 - - runner: macos-14 - target: aarch64 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.platform.target }} - args: --release --out dist -i python3.10 --manifest-path crates/cli/Cargo.toml -F duckdb/bundled - sccache: "true" - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-macos-${{ matrix.platform.target }} - path: dist - - sdist: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build sdist - uses: PyO3/maturin-action@v1 - with: - command: sdist - args: --out dist --manifest-path crates/cli/Cargo.toml - - name: Upload sdist - uses: actions/upload-artifact@v4 - with: - name: wheels-sdist - path: dist - - release: - name: Release - runs-on: ubuntu-latest - if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} - needs: [linux, musllinux, windows, macos, sdist] - environment: - name: pypi - url: https://pypi.org/p/stacrs-cli - permissions: - id-token: write - contents: write - attestations: write - steps: - - uses: actions/download-artifact@v4 - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v1 - with: - subject-path: "wheels-*/*" - - name: Publish to PyPI - if: ${{ startsWith(github.ref, 'refs/tags/') }} - uses: PyO3/maturin-action@v1 - with: - command: upload - args: --non-interactive --skip-existing wheels-*/* diff --git a/README.md b/README.md index 433ffae1..6b7e3f88 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Our command line interface (CLI) can query STAC APIs, validate STAC, and more. Install: ```shell -pip install stacrs-cli +pip install stacrs # or cargo install stac-cli ``` diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 89b26d43..0c215df2 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -14,7 +14,6 @@ rust-version.workspace = true [features] default = ["pgstac"] pgstac = ["stac-server/pgstac", "dep:tokio-postgres"] -python = ["dep:pyo3", "pgstac"] [dependencies] anyhow.workspace = true @@ -23,7 +22,6 @@ clap = { workspace = true, features = ["derive"] } duckdb = { workspace = true, features = ["bundled"] } libduckdb-sys = { workspace = true } object_store.workspace = true -pyo3 = { workspace = true, optional = true, features = ["abi3-py310"] } reqwest.workspace = true serde.workspace = true serde_json.workspace = true diff --git a/crates/cli/README.md b/crates/cli/README.md index 6a63c68b..b7484445 100644 --- a/crates/cli/README.md +++ b/crates/cli/README.md @@ -10,12 +10,6 @@ Command Line Interface (CLI) for [STAC](https://stacspec.org/), named `stacrs`. ## Installation -```shell -python -m pip install stacrs-cli -``` - -Or: - ```sh cargo install stac-cli ``` @@ -64,7 +58,6 @@ Use the `--help` flag to see all available options for the CLI and the subcomman This crate has two features: - `pgstac`: enable a [pgstac](https://github.com/stac-utils/pgstac) backend for `stacrs serve` (enabled by default) -- `python`: create an entrypoint that can be called from Python (used to enable `python -m pip install stacrs-cli`) ## Other info diff --git a/crates/cli/pyproject.toml b/crates/cli/pyproject.toml deleted file mode 100644 index 7ad54537..00000000 --- a/crates/cli/pyproject.toml +++ /dev/null @@ -1,35 +0,0 @@ -[build-system] -requires = ["maturin>=1.7,<2.0"] -build-backend = "maturin" - -[project] -name = "stacrs-cli" -description = "A STAC command-line interface written in Rust" -readme = "README.md" -authors = [{ name = "Pete Gadomski", email = "pete.gadomski@gmail.com" }] -requires-python = ">=3.10" -classifiers = [ - "Development Status :: 3 - Alpha", - "Intended Audience :: Science/Research", - "Natural Language :: English", - "Programming Language :: Rust", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "License :: OSI Approved :: Apache Software License", - "License :: OSI Approved :: MIT License", -] -keywords = ["stac", "geospatial"] -dynamic = ["version"] -dependencies = ["cffi==1.17.1"] - -[project.urls] -Repository = "https://github.com/stac-utils/stac-rs" -Issues = "https://github.com/stac-utils/stac-rs/issues" - -[project.scripts] -stacrs = "stacrs_cli:main" - -[tool.maturin] -no-default-features = true -features = ["python", "pyo3/extension-module"] -module-name = "stacrs_cli" diff --git a/crates/cli/release.toml b/crates/cli/release.toml deleted file mode 100644 index a38fbea7..00000000 --- a/crates/cli/release.toml +++ /dev/null @@ -1 +0,0 @@ -enable-all-features = false diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs index c5ba9b9e..58bcba31 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -11,9 +11,6 @@ use std::{collections::HashMap, io::Write, str::FromStr}; use tokio::{io::AsyncReadExt, net::TcpListener, runtime::Handle}; use tracing::metadata::Level; -#[cfg(feature = "python")] -mod python; - /// stacrs: A command-line interface for the SpatioTemporal Asset Catalog (STAC) #[derive(Debug, Parser)] pub struct Stacrs { diff --git a/crates/cli/src/python.rs b/crates/cli/src/python.rs deleted file mode 100644 index 44fa8b23..00000000 --- a/crates/cli/src/python.rs +++ /dev/null @@ -1,42 +0,0 @@ -use crate::Stacrs; -use clap::Parser; -use pyo3::{ - prelude::{PyModule, PyModuleMethods}, - pyfunction, pymodule, - types::PyAnyMethods, - wrap_pyfunction, Bound, PyResult, Python, -}; - -#[pyfunction] -fn main(py: Python<'_>) -> PyResult { - let signal = py.import("signal")?; - let _ = signal - .getattr("signal")? - .call1((signal.getattr("SIGINT")?, signal.getattr("SIG_DFL")?))?; - let args = Stacrs::parse_from(std::env::args_os().skip(1)); - tracing_subscriber::fmt() - .with_max_level(args.log_level()) - .init(); - std::process::exit( - tokio::runtime::Builder::new_multi_thread() - .enable_all() - .build() - .unwrap() - .block_on(async { - // We skip one because the first argument is going to be the python interpreter. - match args.run().await { - Ok(()) => 0, - Err(err) => { - eprintln!("ERROR: {}", err); - 1 - } - } - }), - ) -} - -#[pymodule] -fn stacrs_cli(m: &Bound<'_, PyModule>) -> PyResult<()> { - m.add_function(wrap_pyfunction!(main, m)?)?; - Ok(()) -} diff --git a/docs/cli/index.md b/docs/cli/index.md index 9165fccd..bca48df8 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -14,7 +14,7 @@ cargo install stac-cli If you have Python, use `pip`: ```shell -python -m pip install stacrs-cli +python -m pip install stacrs ``` The CLI is called **stacrs**: From 76e921f5b1df7a7f0af79f0f21e035c85e41a38f Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Wed, 19 Feb 2025 08:01:25 -0500 Subject: [PATCH 15/18] fix: note the removal of stacrs-cli --- crates/cli/CHANGELOG.md | 4 ++++ crates/cli/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/cli/CHANGELOG.md b/crates/cli/CHANGELOG.md index 87cf77fb..1099bbd5 100644 --- a/crates/cli/CHANGELOG.md +++ b/crates/cli/CHANGELOG.md @@ -12,6 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Always bundle DuckDB (again) ([#631](https://github.com/stac-utils/stac-rs/pull/631)) +### Removed + +- **stacrs-cli** (moved to ) ([#633](https://github.com/stac-utils/stac-rs/pull/633)) + ## [0.5.0] - 2025-01-31 ### Changed diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 0c215df2..c21b90bc 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "stac-cli" description = "Command line interface for stac-rs" -version = "0.5.1-rc.4" +version = "0.5.1" keywords = ["geospatial", "stac", "metadata", "geo", "raster"] authors.workspace = true edition.workspace = true From 72a05e8da6cd9832d44f48cefae978fdb645dc71 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Wed, 19 Feb 2025 08:38:31 -0500 Subject: [PATCH 16/18] ci: allow not bundling duckdb --- .github/workflows/ci.yml | 10 ++++++---- crates/cli/Cargo.toml | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d5d20d3..0e8ff786 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,12 +58,14 @@ jobs: run: | wget https://github.com/duckdb/duckdb/releases/download/v1.1.3/libduckdb-linux-amd64.zip unzip libduckdb-linux-amd64.zip -d /opt/duckdb - - name: Lint - run: scripts/lint + - name: Format + run: cargo fmt --check + - name: Clippy + run: cargo clippy --workspace --no-default-features -- -D warnings - name: Build # need to build first to get the executable for CLI tests - run: cargo build --all-features + run: cargo build --workspace --no-default-features - name: Test - run: cargo test --all-features + run: cargo test --workspace --no-default-features - name: Validate stac-server run: uv run --group stac-api-validator scripts/validate-stac-server - name: Validate stac-geoparquet diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index c21b90bc..2c622510 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -12,14 +12,15 @@ categories.workspace = true rust-version.workspace = true [features] -default = ["pgstac"] +default = ["duckdb-bundled", "pgstac"] pgstac = ["stac-server/pgstac", "dep:tokio-postgres"] +duckdb-bundled = ["duckdb/bundled"] [dependencies] anyhow.workspace = true axum.workspace = true clap = { workspace = true, features = ["derive"] } -duckdb = { workspace = true, features = ["bundled"] } +duckdb = { workspace = true } libduckdb-sys = { workspace = true } object_store.workspace = true reqwest.workspace = true From b634d22176e6d0e8f77f1424dda00281f6e3ecd1 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Wed, 19 Feb 2025 09:17:20 -0500 Subject: [PATCH 17/18] fix: clippy --- crates/cli/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs index 58bcba31..5a587051 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -369,7 +369,7 @@ impl Stacrs { } #[cfg(not(feature = "pgstac"))] { - return Err(anyhow!("stacrs is not compiled with pgstac support")); + Err(anyhow!("stacrs is not compiled with pgstac support")) } } else { let backend = stac_server::MemoryBackend::new(); From ec8684937bc21100cd15abd443eb5957f3ee3863 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Wed, 19 Feb 2025 09:23:29 -0500 Subject: [PATCH 18/18] fix: don't test workspace --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e8ff786..4e6b15e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,9 +63,9 @@ jobs: - name: Clippy run: cargo clippy --workspace --no-default-features -- -D warnings - name: Build # need to build first to get the executable for CLI tests - run: cargo build --workspace --no-default-features + run: cargo build --no-default-features - name: Test - run: cargo test --workspace --no-default-features + run: cargo test --no-default-features - name: Validate stac-server run: uv run --group stac-api-validator scripts/validate-stac-server - name: Validate stac-geoparquet