Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f6aed79
updated workflows to match new project structure
ttrotto Jun 30, 2026
dc04e62
new project structure: rust crate and python wrapper
ttrotto Jun 30, 2026
2c85110
build docs and test PRs
ttrotto Jun 30, 2026
6cf8143
moved benchmarks
ttrotto Jun 30, 2026
89b7cd8
zensical python documentation
ttrotto Jun 30, 2026
7adbdaf
moved python wrapper
ttrotto Jun 30, 2026
b3b18c2
standalone python wrapper around pure Rust crate
ttrotto Jun 30, 2026
335dae2
major refactor: pure trait-based rust crate, explicit errors, more ex…
ttrotto Jun 30, 2026
33b44ee
virtual workspace
ttrotto Jun 30, 2026
33728e1
update gitignore
ttrotto Jun 30, 2026
83440ff
update READMEs
ttrotto Jun 30, 2026
8b9dbc9
derive Clone for common structures
ttrotto Jun 30, 2026
bdd9516
replace hashmap for grouping with btreemap
ttrotto Jun 30, 2026
6d50c0b
minor changes
ttrotto Jun 30, 2026
03efcba
add profiling to hot functions via `hotpath`
ttrotto Jun 30, 2026
19c5aab
update gitignore
ttrotto Jun 30, 2026
9dd192d
update cargo and readme
ttrotto Jun 30, 2026
14eb760
try excluding folder
ttrotto Jun 30, 2026
285a347
do not autodiscover example
ttrotto Jun 30, 2026
0c06adb
updated github workflows
ttrotto Jun 30, 2026
da82145
updated docs
ttrotto Jun 30, 2026
e5781df
update readme and cargo lock
ttrotto Jun 30, 2026
f7690c3
update rust docs link
ttrotto Jun 30, 2026
95aa080
update usage
ttrotto Jun 30, 2026
55df755
forgot to include data for python tests
ttrotto Jun 30, 2026
e2bb736
adjusted pr.yml to hopefully correctly import gdal
ttrotto Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/crates-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish crate

on:
release:
types: [published]

permissions:
contents: read
id-token: write

jobs:
publish-to-crates:
if: startsWith(github.ref_name, 'rs-v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Verify release tag matches Cargo.toml version
shell: bash
run: |
cargo_version=$(grep -m1 '^version = ' rust/Cargo.toml | sed -E 's/^version = "(.*)"/\1/')
tag="${GITHUB_REF_NAME#rs-v}"
echo "Cargo.toml version: $cargo_version"
echo "Release tag: $tag"
if [ "$cargo_version" != "$tag" ]; then
echo "::error::Release tag ($tag) does not match rust/Cargo.toml version ($cargo_version). Bump Cargo.toml or fix the tag."
exit 1
fi

- name: Authenticate to crates.io
uses: rust-lang/crates-io-auth-action@v1
id: auth

- name: Publish to crates.io
run: cargo publish --manifest-path rust/Cargo.toml
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
29 changes: 29 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Documentation
on:
push:
branches:
- main
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/configure-pages@v5
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install zensical
- run: zensical build --clean
working-directory: python
- uses: actions/upload-pages-artifact@v4
with:
path: python/site
- uses: actions/deploy-pages@v4
id: deployment
42 changes: 42 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: PR

on:
pull_request:

permissions:
contents: read

jobs:
rust-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: cargo test
run: cargo test -p rusterize-rs

python-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"

- name: Install GDAL system libs
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gdal-bin libgdal-dev

- name: Build extension + install test deps
run: |
pip install maturin
maturin build --out dist
pip install numpy setuptools wheel
pip install --no-build-isolation gdal==$(gdal-config --version)
pip install "$(ls dist/*.whl)[all]" pytest

- name: pytest
run: pytest test/
20 changes: 13 additions & 7 deletions .github/workflows/CI.yml → .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ permissions:

jobs:
check-version:
if: startsWith(github.ref_name, 'py-v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Verify release tag matches Cargo.toml version
shell: bash
run: |
cargo_version=$(grep -m1 '^version = ' Cargo.toml | sed -E 's/^version = "(.*)"/\1/')
tag="${GITHUB_REF_NAME#v}"
cargo_version=$(grep -m1 '^version = ' python/Cargo.toml | sed -E 's/^version = "(.*)"/\1/')
tag="${GITHUB_REF_NAME#py-v}"
echo "Cargo.toml version: $cargo_version"
echo "Release tag: $tag"
if [ "$cargo_version" != "$tag" ]; then
Expand Down Expand Up @@ -54,6 +55,7 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: python
target: ${{ matrix.platform.target }}
args: --profile dist-release --out dist --find-interpreter
sccache: "true"
Expand All @@ -63,7 +65,7 @@ jobs:
uses: actions/upload-artifact@v5
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist
path: python/dist

musllinux:
needs: check-version
Expand Down Expand Up @@ -93,6 +95,7 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: python
target: ${{ matrix.platform.target }}
args: --profile dist-release --out dist --find-interpreter
sccache: "true"
Expand All @@ -102,7 +105,7 @@ jobs:
uses: actions/upload-artifact@v5
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: dist
path: python/dist

windows:
needs: check-version
Expand All @@ -129,6 +132,7 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: python
target: ${{ matrix.platform.target }}
args: --profile dist-release --out dist --find-interpreter
sccache: "true"
Expand All @@ -137,7 +141,7 @@ jobs:
uses: actions/upload-artifact@v5
with:
name: wheels-windows-${{ matrix.platform.target }}
path: dist
path: python/dist

macos:
needs: check-version
Expand Down Expand Up @@ -165,6 +169,7 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: python
target: ${{ matrix.platform.target }}
args: --profile dist-release --out dist --find-interpreter
sccache: "true"
Expand All @@ -173,7 +178,7 @@ jobs:
uses: actions/upload-artifact@v5
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist
path: python/dist

sdist:
needs: check-version
Expand All @@ -183,13 +188,14 @@ jobs:
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
working-directory: python
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v5
with:
name: wheels-sdist
path: dist
path: python/dist

publish-to-pypi:
name: Publish to PyPI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Verify input version matches Cargo.toml version
shell: bash
run: |
cargo_version=$(grep -m1 '^version = ' Cargo.toml | sed -E 's/^version = "(.*)"/\1/')
cargo_version=$(grep -m1 '^version = ' python/Cargo.toml | sed -E 's/^version = "(.*)"/\1/')
tag="${{ inputs.version }}"
tag="${tag#v}"
echo "Cargo.toml version: $cargo_version"
Expand Down Expand Up @@ -64,6 +64,7 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: python
target: ${{ matrix.platform.target }}
args: --profile dist-release --out dist --find-interpreter
sccache: "true"
Expand All @@ -73,7 +74,7 @@ jobs:
uses: actions/upload-artifact@v5
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist
path: python/dist

musllinux:
needs: check-version
Expand Down Expand Up @@ -103,6 +104,7 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: python
target: ${{ matrix.platform.target }}
args: --profile dist-release --out dist --find-interpreter
sccache: "true"
Expand All @@ -112,7 +114,7 @@ jobs:
uses: actions/upload-artifact@v5
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: dist
path: python/dist

windows:
needs: check-version
Expand All @@ -139,6 +141,7 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: python
target: ${{ matrix.platform.target }}
args: --profile dist-release --out dist --find-interpreter
sccache: "true"
Expand All @@ -147,7 +150,7 @@ jobs:
uses: actions/upload-artifact@v5
with:
name: wheels-windows-${{ matrix.platform.target }}
path: dist
path: python/dist

macos:
needs: check-version
Expand Down Expand Up @@ -175,6 +178,7 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: python
target: ${{ matrix.platform.target }}
args: --profile dist-release --out dist --find-interpreter
sccache: "true"
Expand All @@ -183,7 +187,7 @@ jobs:
uses: actions/upload-artifact@v5
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist
path: python/dist

sdist:
needs: check-version
Expand All @@ -193,13 +197,14 @@ jobs:
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
working-directory: python
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v5
with:
name: wheels-sdist
path: dist
path: python/dist

publish-to-testpypi:
name: Publish to TestPyPI
Expand Down
18 changes: 8 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/
dist/
Expand All @@ -8,9 +7,6 @@ dist_base/
# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# environment
.venv
.env
Expand All @@ -23,22 +19,24 @@ uv.lock

# Pycache
**/__pycache__
.pytest_cache
**/.pytest_cache

# Benchmarks
.benchmarks

# Other stuff
README_files
.ruff_cache
benchmarks/data
python/benchmarks/data
.git
**/*.aux.xml
**/*.cache

# Temporary maturin development
*.pyd

# Jupyter Notebooks
.ipynb_checkpoints
*/.ipynb_checkpoints/*
dev_notebooks/
# Zensical
python/site

# Profiling
rust/examples
Loading