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
52 changes: 22 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,32 @@
---
name: ci

on:
push:
branches:
- main
branches: [main]
pull_request:

jobs:
build:

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Lint
run: make lint
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.14']

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

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install from source
run: uv sync --locked

- name: Ruff lint
run: uv run ruff check .

- name: Ruff format
run: uv run ruff format --check .

- name: Type check
run: uv run ty check

- name: Test
run: uv run pytest
- uses: actions/checkout@v4
with:
submodules: true
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
- name: Test
run: make test
15 changes: 6 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
---
name: publish

on:
release:
types: [published]

jobs:
build:
uses: ./.github/workflows/wheels.yml

publish:
name: Publish to PyPI
needs: build
Expand All @@ -18,9 +16,8 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
87 changes: 37 additions & 50 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
---
name: wheels

on:
push:
branches:
- main
tags:
- 'v*'
branches: [main]
tags: [v*]
pull_request:
workflow_dispatch:
workflow_call:

jobs:
build_wheels:
name: Wheels (${{ matrix.os }} ${{ matrix.archs }})
Expand All @@ -26,33 +23,27 @@ jobs:
archs: arm64
- os: windows-latest
archs: AMD64

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v4.1.0
env:
CIBW_ARCHS: ${{ matrix.archs }}

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

- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v4.1.0
env:
CIBW_ARCHS: ${{ matrix.archs }}
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.archs }}
path: wheelhouse/*.whl
build_sdist:
name: sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz

# Windows ships an AMD64 wheel (see build_wheels); this guards the remaining
# from-source path there (e.g. win_arm64, or pip falling back to the sdist).
Expand All @@ -61,25 +52,21 @@ jobs:
needs: build_sdist
runs-on: windows-latest
steps:
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist

- uses: actions/setup-python@v5
with:
python-version: '3.13'

- uses: actions/checkout@v4
with:
path: src

- name: Install from sdist
shell: bash
run: pip install --verbose dist/*.tar.gz

- name: Test
shell: bash
run: |
pip install pytest numpy
pytest src/tests/
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- uses: actions/checkout@v4
with:
path: src
- name: Install from sdist
shell: bash
run: pip install --verbose dist/*.tar.gz
- name: Test
shell: bash
run: |-
pip install pytest numpy
pytest src/tests/
1 change: 1 addition & 0 deletions .mdformat.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
number = true
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type stub, alongside several binding fixes. Drops Python 3.9, which reached end
of life; the minimum is now Python 3.10.

### Added

- `ColorOcTree` and `ColorOcTreeNode` bindings, exposing a per-voxel RGB color
(`setNodeColor` / `averageNodeColor` / `integrateNodeColor`, node `getColor` /
`setColor` / `isColorSet` / `getAverageChildColor`) on top of the shared
Expand All @@ -31,6 +32,7 @@ of life; the minimum is now Python 3.10.
type checkers and editor completion (#65).

### Changed

- The occupancy/search/IO surface shared by every tree now lives on a common
`OccupancyOcTreeBase`, which both `OcTree` and `ColorOcTree` extend. `OcTree`'s
public API is unchanged (#66).
Expand All @@ -42,11 +44,13 @@ of life; the minimum is now Python 3.10.
- Build pinned to Cython 3 and NumPy 2 (#65).

### Fixed

- `OcTree.read()` and `ColorOcTree.read()` now raise instead of segfaulting when
given a path that does not resolve to a valid OctoMap file (#70).
- `adjustKeyAtDepth` now returns an `OcTreeKey` instance (#61).

### Removed

- Python 3.9 support, which reached end of life; the minimum is now Python 3.10
(#71).

Expand All @@ -56,15 +60,18 @@ The first release in over six years: a full build and tooling modernization plus
several long-standing binding fixes.

### Added

- `dynamicEDT_getDistanceAndClosestObstacle` binding for the Euclidean distance transform (#37).

### Fixed

- `castRay` now fills the `end` coordinate whether or not the ray hits an occupied voxel (#36).
- OctoMap file paths accept `str`, not only `bytes` (#38).
- Iterator crash caused by the name-mangled `__is_end` / `__is_acceseable` attributes (#23).
- Compilation on modern compilers, by pinning the OctoMap build to C++14 (#24).

### Changed

- Build migrated to scikit-build-core, producing a statically linked extension (#40).
- OctoMap C++ is fetched and pinned via CMake FetchContent instead of a git submodule (#41).
- Binary wheels (CPython 3.9-3.13; manylinux x86_64/aarch64, macOS arm64) and an sdist are built with cibuildwheel (#49).
Expand All @@ -77,72 +84,87 @@ several long-standing binding fixes.
- CI tests the lower and upper supported Python bounds, 3.9 and 3.14 (#47).

### Removed

- Python 2 and Python 3.5 support, alongside repository housekeeping and an added LICENSE file (#35).

## [1.8.0.post12] - 2019-07-03

### Removed

- `bbx_min` and `bbx_max` arguments from `extractPointCloud`.

## [1.8.0.post11] - 2019-07-02

### Fixed

- Output dimension of `extractPointCloud`.

## [1.8.0.post10] - 2019-06-29

### Added

- `bbx_min` and `bbx_max` arguments to `extractPointCloud`.

## [1.8.0.post9] - 2019-06-21

### Changed

- Reverted linking against static libraries.

### Removed

- Unused `opengl_camera_transform`.

## [1.8.0.post8] - 2019-06-21

### Changed

- Linked against static libraries.

## [1.8.0.post7] - 2019-06-21

### Fixed

- Further handling of empty point clouds.

## [1.8.0.post6] - 2019-06-21

### Fixed

- Zero-sized point cloud handling in `extractPointCloud`.

## [1.8.0.post5] - 2019-06-11

### Changed

- Maintenance re-release; no functional changes.

## [1.8.0.post4] - 2019-05-08

### Added

- `README.md` to the source distribution manifest.

## [1.8.0.post3] - 2019-05-08

### Added

- `extractPointCloud`, plus visualization helpers and example scripts.

### Changed

- `getMetric*` methods return `numpy.ndarray`.

## [1.8.0.post2] - 2019-04-16

### Changed

- README and `setup.py` packaging metadata.

## [1.8.0.post1] - 2019-04-16

### Added

- Initial PyPI release of the OctoMap Python binding (bundling OctoMap 1.8.0):
OcTree read/write, node and tree iterators, `OcTreeKey`, ray casting, and a
dynamicEDT3D distance field.
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
ifneq ($(OS),Windows_NT)
SHELL := bash
endif

.PHONY: help setup format lint test coverage
.DEFAULT_GOAL := help

PYTEST_ARGS ?= --numprocesses=auto

define exec
@uv run --no-sync python -c "print('\033[1;36m$(1)\033[0m')"
@$(1)
endef

help:
@uv run --no-sync python -c "import re; lines=open('Makefile').read().splitlines(); print('\033[1;32mAvailable targets:\033[0m'); [print(f' \033[1;36m{m.group(1):<20s}\033[0m {m.group(2)}') for l in lines if (m:=re.match(r'^([a-zA-Z_-]+):.*?# (.+)$$',l))]"

setup: # Setup the development environment
$(call exec,uv sync)

lint: # Lint code
$(call exec,uv run ruff format --check)
$(call exec,uv run ruff check)
$(call exec,uv run ty check --no-progress)
$(call exec,git ls-files "*.toml" | xargs uv run taplo fmt --check)
$(call exec,git ls-files "*.md" | xargs uv run mdformat --check)
$(call exec,git ls-files "*.yml" "*.yaml" | xargs uv run yamlfix --check)
$(call exec,uv run typos)

format: # Format code
$(call exec,uv run ruff format)
$(call exec,uv run ruff check --fix)
$(call exec,git ls-files "*.toml" | xargs uv run taplo fmt)
$(call exec,git ls-files "*.md" | xargs uv run mdformat)
$(call exec,git ls-files "*.yml" "*.yaml" | xargs uv run yamlfix)

test: # Run tests
$(call exec,uv run pytest -v tests/ $(PYTEST_ARGS))

coverage: # Run tests with coverage
$(MAKE) test PYTEST_ARGS="--cov=octomap --cov-report=term-missing"
5 changes: 5 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# `leafs` mirrors OctoMap's upstream C++ API (begin_leafs/end_leafs); `ot` is
# the full-map file extension (.ot), as opposed to the binary tree (.bt).
[default.extend-words]
leafs = "leafs"
ot = "ot"
Loading
Loading