Skip to content
Merged
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
10 changes: 6 additions & 4 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@ on:

jobs:
build:
name: Build with Pip
strategy:
fail-fast: false
matrix:
platform: [ubuntu-20.04, windows-2019, macos-13]
python-version: ["3.9"]
platform: [windows-latest, macos-latest, ubuntu-latest]
python-version: ["3.9", "3.12"]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Add requirements
run: python -m pip install --upgrade wheel setuptools
Expand Down
36 changes: 28 additions & 8 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ on:
types:
- published

env:
FORCE_COLOR: 3

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -25,8 +32,9 @@ jobs:
- name: Check metadata
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz


Expand All @@ -39,7 +47,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -49,7 +57,7 @@ jobs:
with:
platforms: all

- uses: pypa/cibuildwheel@v2.17.0
- uses: pypa/cibuildwheel@v2.22
env:
# CIBW_ARCHS: auto64
CIBW_ARCHS_LINUX: x86_64 aarch64
Expand All @@ -65,8 +73,9 @@ jobs:
shell: bash

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: wheelhouse/*.whl


Expand All @@ -75,17 +84,28 @@ jobs:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
environment: pypi
permissions:
id-token: write
attestations: write

steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
pattern: cibw-*
path: dist

- uses: pypa/gh-action-pypi-publish@v1.6.4
- name: Generate artifact attestation for sdist and wheels
uses: actions/attest-build-provenance@v1
with:
subject-path: "dist/*"

- uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion headers
Submodule headers updated 808 files
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "pybind11_geobuf"
version = "0.2.2"
url = "https://geobuf-cpp.readthedocs.io"
version = "0.2.3"
description="c++ geobuf with python binding"
readme = "README.md"
authors = [
Expand All @@ -25,6 +24,11 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]


[project.urls]
Homepage = "https://geobuf-cpp.readthedocs.io"


[project.optional-dependencies]
test = ["pytest", "scipy"]

Expand Down
14 changes: 8 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ PYBIND11_MODULE(_core, m)
str: Decoded and formatted PBF content as a string.
)docstring");

py::class_<Encoder>(m, "Encoder", py::module_local()) //
.def(py::init<uint32_t, bool, std::optional<int>>(), //
py::class_<Encoder>(m, "Encoder", py::module_local(), py::dynamic_attr()) //
.def(py::init<uint32_t, bool, std::optional<int>>(), //
py::kw_only(),
"max_precision"_a = static_cast<uint32_t>(
std::pow(10, MAPBOX_GEOBUF_DEFAULT_PRECISION)),
Expand Down Expand Up @@ -366,7 +366,7 @@ PYBIND11_MODULE(_core, m)
//
;

py::class_<Decoder>(m, "Decoder", py::module_local()) //
py::class_<Decoder>(m, "Decoder", py::module_local(), py::dynamic_attr()) //
.def(py::init<>(),
R"docstring(
Initialize a Decoder object.
Expand Down Expand Up @@ -566,7 +566,8 @@ PYBIND11_MODULE(_core, m)
;

using PackedRTree = FlatGeobuf::PackedRTree;
py::class_<PackedRTree>(m, "PackedRTree", py::module_local())
py::class_<PackedRTree>(m, "PackedRTree", py::module_local(),
py::dynamic_attr())
.def(
"search",
[](const PackedRTree &self, double minX, double minY, double maxX,
Expand Down Expand Up @@ -613,7 +614,7 @@ PYBIND11_MODULE(_core, m)
;

using Planet = cubao::Planet;
py::class_<Planet>(m, "Planet", py::module_local())
py::class_<Planet>(m, "Planet", py::module_local(), py::dynamic_attr())
.def(py::init<>(), R"docstring(
Initialize an empty Planet object.
)docstring")
Expand Down Expand Up @@ -697,7 +698,8 @@ PYBIND11_MODULE(_core, m)
;

using GeobufIndex = cubao::GeobufIndex;
py::class_<GeobufIndex>(m, "GeobufIndex", py::module_local()) //
py::class_<GeobufIndex>(m, "GeobufIndex", py::module_local(),
py::dynamic_attr()) //
.def(py::init<>(), R"docstring(
Default constructor for GeobufIndex.
)docstring")
Expand Down
4 changes: 2 additions & 2 deletions src/pybind11_rapidjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using RapidjsonDocument = mapbox::geojson::rapidjson_document;
void bind_rapidjson(py::module &m)
{
auto rj =
py::class_<RapidjsonValue>(m, "rapidjson") //
py::class_<RapidjsonValue>(m, "rapidjson", py::module_local()) //
.def(py::init<>(), "Initialize an empty RapidJSON value")
.def(py::init(
[](const py::object &obj) { return to_rapidjson(obj); }),
Expand Down Expand Up @@ -402,7 +402,7 @@ void bind_rapidjson(py::module &m)
.def(py::self != py::self, "Compare two RapidJSON values for inequality")
//
;
py::enum_<rapidjson::Type>(rj, "type")
py::enum_<rapidjson::Type>(rj, "type", py::module_local())
.value("kNullType", rapidjson::kNullType, "Null type")
.value("kFalseType", rapidjson::kFalseType, "False type")
.value("kTrueType", rapidjson::kTrueType, "True type")
Expand Down