Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Python Bindings via snapr-py #9

Merged
merged 40 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0b5c5d9
Empty canvas for `snapr-py`
c1m50c Oct 7, 2024
3fb31f2
Implement `snapr_py::Snapr` methods for using underlying `snapr` crate
c1m50c Oct 7, 2024
a175dd3
Merge remote-tracking branch 'origin/main' into python-bindings
c1m50c Oct 8, 2024
d6abe0e
Move `get_snapr` logic into `generate_snapshot_from_geometries`
c1m50c Oct 8, 2024
1cbb198
Implement `generate_snapshot_from_geometry`
c1m50c Oct 8, 2024
68f78e3
Merge remote-tracking branch 'origin/main' into python-bindings
c1m50c Oct 8, 2024
7608c68
Add `pyo3` wrappers for `geo` types
c1m50c Oct 10, 2024
d99f976
Image snapshot rendering
c1m50c Oct 10, 2024
eec421a
Add `snapr.pyi` for type stubs
c1m50c Oct 10, 2024
bae25d5
Use `PyGeometry` instead of dictionaries for rendering a single geometry
c1m50c Oct 10, 2024
2cb04f0
Annotate `tile_fetcher` with an extended `Callable` type
c1m50c Oct 10, 2024
222748b
Rename `types.rs` to `geo.rs`
c1m50c Oct 10, 2024
60ce879
Add `styles` module to Python bindings
c1m50c Oct 13, 2024
42892ec
Add explicit class names to `style` module
c1m50c Oct 13, 2024
7aa4d00
Fix `.pyi` file and other thangs'
c1m50c Oct 14, 2024
0597b7f
Merge remote-tracking branch 'origin/main' into python-bindings
c1m50c Oct 14, 2024
ee9735c
Merge remote-tracking branch 'origin/main' into python-bindings
c1m50c Oct 14, 2024
6902214
Fix `point.py` example
c1m50c Oct 14, 2024
72fc8ea
Use `BatchTileFetcher` for Python-based tile fetching
c1m50c Oct 14, 2024
c308e16
Create `publish_snapr_py.yml` workflow
c1m50c Oct 14, 2024
f9412b8
Fix typos in `publish_snapr_py.yml`
c1m50c Oct 14, 2024
e5a4582
Create `verify_py.yml` workflow
c1m50c Oct 14, 2024
32b8acc
Add `working-directory` directive to workflows
c1m50c Oct 14, 2024
5028bbc
Merge `verify_py.yml` into `verify.yml`
c1m50c Oct 16, 2024
83a6862
Swap `Snapr::tile_fetcher` to `Py<PyAny>` for PyPy releases
c1m50c Oct 16, 2024
749e9eb
Fix `clippy` warnings
c1m50c Oct 16, 2024
ec5ed20
Merge `publish_snapr.yml` into `publish_snapr_py.yml`
c1m50c Oct 16, 2024
f0226fe
Add `version.workspace` to `snapr-py`
c1m50c Oct 16, 2024
4fc9bbe
Add `needs` field to `publish.yml` workflow
c1m50c Oct 16, 2024
b08dc75
Convert Python `geo` wrapper types to use `PyPoint` for coords
c1m50c Oct 16, 2024
f5dc9d0
Add `PyPointOrTuple` type to make passing `PyPoint`s easier
c1m50c Oct 16, 2024
d25c609
Add `#[allow(clippy::from_over_into)]` attributes where needed
c1m50c Oct 16, 2024
03d9e79
Disable `fail-fast` for `verify.yml` matricies
c1m50c Oct 16, 2024
7b3a906
Simplify `examples/point.py`
c1m50c Oct 16, 2024
d1f3621
Update `snapr-py/README.md`
c1m50c Oct 16, 2024
0bbc214
Bump `package.version` to `0.4.2`
c1m50c Oct 16, 2024
9fddeb2
Add `actions-rust-lang/setup-rust-toolchain@v1` to cache `cargo`
c1m50c Oct 16, 2024
0cae51a
Revert "Bump `package.version` to `0.4.2`"
c1m50c Oct 16, 2024
6b1992a
Reapply "Bump `package.version` to `0.4.2`"
c1m50c Oct 16, 2024
569a44b
Revert "Add `actions-rust-lang/setup-rust-toolchain@v1` to cache `car…
c1m50c Oct 16, 2024
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
216 changes: 214 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ on:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

permissions:
contents: read

jobs:
publish:
# region Publish Snapr
publish-snapr:
name: Publish - `crates.io`
runs-on: ubuntu-latest
steps:
Expand All @@ -23,4 +27,212 @@ jobs:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
run: |
cargo publish --all-features --verbose -p snapr
cargo publish --all-features --verbose -p snapr

# region Upload Linux Wheels
upload-linux-wheels:
strategy:
matrix:
include:
- identifier: x86_64
target: x86_64

- identifier: x86
target: x86

- identifier: ARM64
target: aarch64

name: Upload Wheels - Linux - ${{ matrix.identifier }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Build Wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist --find-interpreter
manylinux: auto
sccache: "true"
target: ${{ matrix.target }}
working-directory: snapr-py

- name: Upload Wheels - `${{matrix.identifier}}`
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.target }}
path: dist

# region Upload Musl Wheels
upload-musl-wheels:
strategy:
matrix:
include:
- identifier: x86_64
target: x86_64

- identifier: x86
target: x86

- identifier: ARM64
target: aarch64

name: Upload Wheels - Musl - ${{ matrix.identifier }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Build Wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist --find-interpreter
manylinux: musllinux_1_2
sccache: "true"
target: ${{ matrix.target }}
working-directory: snapr-py

- name: Upload Wheels - `${{matrix.identifier}}`
uses: actions/upload-artifact@v4
with:
name: wheels-musl-${{ matrix.target }}
path: dist

# region Upload Windows Wheels
upload-windows-wheels:
strategy:
matrix:
include:
- identifier: x64
target: x64

- identifier: x86
target: x86

name: Upload Wheels - Windows - ${{ matrix.identifier }}
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v5
with:
architecture: ${{ matrix.target }}
python-version: 3.x

- name: Build Wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist --find-interpreter
sccache: "true"
target: ${{ matrix.target }}
working-directory: snapr-py

- name: Upload Wheels - `${{matrix.identifier}}`
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.target }}
path: dist

# region Upload MacOS Wheels
upload-macos-wheels:
strategy:
matrix:
include:
- identifier: x86_64
os: macos-12
target: x86_64

- identifier: ARM64
os: macos-14
target: aarch64

name: Upload Wheels - MacOS - ${{ matrix.identifier }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Build Wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist --find-interpreter
sccache: "true"
target: ${{ matrix.target }}
working-directory: snapr-py

- name: Upload Wheels - `${{matrix.identifier}}`
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.target }}
path: dist

# region Upload Source Distribution
upload-source-distribution:
name: Upload Source Distribution
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Build Source Distribution
uses: PyO3/maturin-action@v1
with:
args: --out dist
command: sdist
working-directory: snapr-py

- name: Upload Source Distribution
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist

# region Publish Snapr.py
publish-snapr-py:
name: Publish - `pypi.org`
runs-on: ubuntu-latest
needs:
- upload-linux-wheels
- upload-macos-wheels
- upload-musl-wheels
- upload-source-distribution
- upload-windows-wheels
permissions:
id-token: write
contents: write
attestations: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4

- name: Generate Artifact Attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: "wheels-*/*"

- name: Publish - `pypi.org`
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
args: --non-interactive --skip-existing wheels-*/*
command: upload
working-directory: snapr-py
Loading
Loading