diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index ac0bcf71..b1aba5af 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -21,67 +21,65 @@ jobs: platform: - runner: ubuntu-latest target: x86_64 - - runner: ubuntu-latest - target: x86 - - runner: ubuntu-latest - target: aarch64 - - runner: ubuntu-latest - target: armv7 - - runner: ubuntu-latest - target: s390x - - runner: ubuntu-latest - target: ppc64le + # - runner: ubuntu-latest + # target: x86 + # - runner: ubuntu-latest + # target: aarch64 + # - runner: ubuntu-latest + # target: armv7 + # - runner: ubuntu-latest + # target: s390x + # - runner: ubuntu-latest + # target: ppc64le steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: 3.x + - name: Set up Rust cache + uses: Swatinem/rust-cache@v2 - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml -F openssl-vendored + args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml sccache: 'true' - manylinux: auto - before-script-linux: | - yum update -y - yum install openssl openssl-devel perl-IPC-Cmd -y - 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-latest - target: x86_64 - - runner: ubuntu-latest - target: x86 - - runner: ubuntu-latest - target: aarch64 - - runner: ubuntu-latest - target: armv7 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.x - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml -F openssl-vendored - sccache: 'true' - manylinux: musllinux_1_2 - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-musllinux-${{ matrix.platform.target }} - path: dist + # musllinux: + # runs-on: ${{ matrix.platform.runner }} + # strategy: + # matrix: + # platform: + # - runner: ubuntu-latest + # target: x86_64 + # - runner: ubuntu-latest + # target: x86 + # - runner: ubuntu-latest + # target: aarch64 + # - runner: ubuntu-latest + # target: armv7 + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # with: + # python-version: 3.x + # - name: Build wheels + # uses: PyO3/maturin-action@v1 + # with: + # target: ${{ matrix.platform.target }} + # args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml -F openssl-vendored + # 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 }} @@ -94,6 +92,8 @@ jobs: target: x86 steps: - uses: actions/checkout@v4 + - name: Set up Rust cache + uses: Swatinem/rust-cache@v2 - uses: actions/setup-python@v5 with: python-version: 3.x @@ -121,6 +121,8 @@ jobs: target: aarch64 steps: - uses: actions/checkout@v4 + - name: Set up Rust cache + uses: Swatinem/rust-cache@v2 - uses: actions/setup-python@v5 with: python-version: 3.x @@ -140,6 +142,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up Rust cache + uses: Swatinem/rust-cache@v2 - name: Build sdist uses: PyO3/maturin-action@v1 with: @@ -154,7 +158,12 @@ jobs: release: name: Release runs-on: ubuntu-latest - needs: [linux, musllinux, windows, macos, sdist] + needs: + - linux + # - musllinux + - windows + - macos + - sdist if: startsWith(github.ref, 'refs/tags/python-') permissions: id-token: write diff --git a/python/CHANGELOG.md b/python/CHANGELOG.md new file mode 100644 index 00000000..bd9280f8 --- /dev/null +++ b/python/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.0.1] - 2024-08-28 + +Initial release. + +[0.0.1]: https://github.com/stac-utils/stac-rs/releases/tag/python-v0.0.1 diff --git a/python/Cargo.toml b/python/Cargo.toml index 25cdcde5..d9602ebd 100644 --- a/python/Cargo.toml +++ b/python/Cargo.toml @@ -8,12 +8,7 @@ publish = false name = "stacrs" crate-type = ["cdylib"] -[features] -# Fixes cross-platform builds in the maturin action -openssl-vendored = ["openssl/vendored"] - [dependencies] -openssl = { version = "0.10", optional = true } pyo3 = "0.22" stac = { version = "0.8", path = "../stac", features = ["reqwest"] } stac-validate = { version = "0.2", path = "../stac-validate" } diff --git a/python/README.md b/python/README.md new file mode 100644 index 00000000..964298f8 --- /dev/null +++ b/python/README.md @@ -0,0 +1,23 @@ +# stacrs + +A Python package for working with [STAC](https://stacspec.org/), using Rust under the hood. + +## Usage + +Install via **pip**: + +```shell +pip install stacrs +``` + +Then: + +```python +import stacrs + +stacrs.validate_href("https://raw.githubusercontent.com/radiantearth/stac-spec/v1.0.0/examples/simple-item.json") +``` + +## Other info + +This crate is part of the [stac-rs](https://github.com/stac-utils/stac-rs) monorepo, see its README for contributing and license information. diff --git a/python/pyproject.toml b/python/pyproject.toml index bc60a6bd..8178ea55 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,13 +4,27 @@ build-backend = "maturin" [project] name = "stacrs" +description = "Work with STAC, using Rust under the hood" +readme = "README.md" +authors = [{ name = "Pete Gadomski", email = "pete.gadomski@gmail.com" }] requires-python = ">=3.8" 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", + "Typing :: Typed", ] +keywords = ["stac", "geospatial"] dynamic = ["version"] +[project.urls] +Repository = "https://github.com/stac-utils/stac-rs/tree/main/python" +Issues = "https://github.com/stac-utils/stac-rs/issues" + [tool.maturin] features = ["pyo3/extension-module"]