Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Georust: use one big prepared geometry #28

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
172 changes: 0 additions & 172 deletions .github/workflows/package.yml

This file was deleted.

119 changes: 119 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# This file is autogenerated by maturin v1.3.2
# To update, run
#
# maturin generate-ci github
#
name: Python Build and test wheels

on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

macos:
runs-on: macos-latest
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }}
with:
command: upload
args: --non-interactive --skip-existing *
12 changes: 6 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.11
architecture: x64

- name: Install deps
run: |
pip install numpy

- run: cargo build --features geos/static --verbose
- run: cargo test --features geos/static --verbose
- run: cargo build --verbose
- run: cargo test --verbose

nightly:
runs-on: ubuntu-latest
Expand All @@ -45,7 +45,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.11
architecture: x64

- name: Install deps
Expand All @@ -54,5 +54,5 @@ jobs:
sudo apt-get -y install build-essential libssl-dev
pip install numpy

- run: cargo build --features geos/static,nightly --verbose
- run: cargo test --features geos/static,nightly --verbose
- run: cargo build --features nightly --verbose
- run: cargo test --features nightly --verbose
21 changes: 12 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,33 @@ name = "make_bitmap"
path = "src/devel/make_bitmap.rs"

[dependencies]
geos = { version = "8" }
geo = "0.28"
lazy_static = "1.4"
numpy = { version = "0.19" }
pyo3 = { version = "0.19" , features = [ "abi3-py38" ] }
numpy = { version = "0.21" }
pyo3 = { version = "0.21" , features = [ "abi3-py310" ] }
roaring = "0.10"
rust-embed = "8"
xz2 = "0.1"
ndarray = { version = "0.15", features = [ "rayon" ] }
wkb = "0.7.1"
rstar = "0.12.0"

[dev-dependencies]
rayon = "1"

[build-dependencies]
reqwest = { version = "0.11", default-features = false, features = [ "blocking", "rustls-tls" ] }
ring = "0.16"
path-slash = "0.1"
reqwest = { version = "0.12", default-features = false, features = [ "blocking", "rustls-tls" ] }
ring = "0.17"
path-slash = "0.2"

[features]
extension-module = ["pyo3/extension-module"]
simd = [ "roaring/simd" ]
static = [ "geos/static" ]
nightly = []
default = []
nightly = [ ]
default = [ ]

[profile.release]
debug = true

[patch.crates-io]
geo = { path = "/home/gauteh/dev/misc/geo/geo" }
7 changes: 5 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use path_slash::PathExt;
use std::env;
use std::fs;
use std::io::prelude::*;
use std::path::Path;
use path_slash::PathExt;

pub static GSHHS_F: &str = "gshhs_f_-180.000000E-90.000000N180.000000E90.000000N.wkb.xz";
pub static GSHHS_F_CS: &str = "05bdf3089407b9829a7a5be7ee43f1e4205f2bbc641e4778af77e4814be216da";
Expand Down Expand Up @@ -83,6 +83,9 @@ fn copy_or_download(from: impl AsRef<Path>, csum: &str) {
if &expected != &actual.as_ref() {
// Delete erronous file
fs::remove_file(&full_to).unwrap();
panic!("Checksum mismatched for {:?}, downloaded file deleted..", &from);
panic!(
"Checksum mismatched for {:?}, downloaded file deleted..",
&from
);
}
}
Loading
Loading