Skip to content

petrasvestartas/wood_nano

Repository files navigation

wood_nano

Python bindings for the wood C++ library using nanobind.

CI status
Build Build
Release Release

Quick Start

pip install wood_nano
import wood_nano as m
print(m.add(1, 2))

Build from Source

All C++ dependencies (CGAL, Boost, Eigen, etc.) are downloaded automatically by CMake.

Windows

git clone --recursive https://github.com/petrasvestartas/wood_nano.git
cd wood_nano
pip install uv
uv venv .venv
.venv\Scripts\activate
uv pip install -r requirements-dev.txt
uv pip install --no-build-isolation -ve .

macOS

git clone --recursive https://github.com/petrasvestartas/wood_nano.git
cd wood_nano
pip install uv
uv venv .venv
source .venv/bin/activate
uv pip install -r requirements-dev.txt
uv pip install --no-build-isolation -ve .

Linux

git clone --recursive https://github.com/petrasvestartas/wood_nano.git
cd wood_nano
pip install uv
uv venv .venv
source .venv/bin/activate
uv pip install -r requirements-dev.txt
uv pip install --no-build-isolation -ve .

Test

python -c "import wood_nano as m; print(m.add(1, 2))"

PyPI Release

Releases are automated via GitHub Actions using trusted publishing.

One-time setup (PyPI):

  1. Go to https://pypi.org/manage/account/publishing/
  2. Add pending publisher:
    • Project: wood_nano
    • Owner: petrasvestartas
    • Repository: wood_nano
    • Workflow: release.yml

To publish a new version:

  1. Update the version number in src/wood_nano/__init__.py:

    __version__ = "0.3.0"  # Change to new version
  2. Commit the version change:

    git add src/wood_nano/__init__.py
    git commit -m "Bump version to 0.3.0"
    git push
  3. Create and push the tag:

    git tag v0.3.0
    git push origin v0.3.0

This triggers the release workflow which builds wheels for all platforms and publishes to PyPI.

Development

Update wood submodule:

git submodule update --init --recursive

Clean rebuild:

rm -rf build .deps
pip install --no-build-isolation -ve .