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

[WIP] Complete rewrite of bindings with nanobind instead of numpyeigen+pybind11 #243

Merged
merged 104 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
4123f98
many working examples
alecjacobson Nov 7, 2024
80371b5
more bindings; move
alecjacobson Nov 8, 2024
b5d7031
noop tests; min_quad_with_fixed
alecjacobson Nov 8, 2024
3412fbc
handle overloads more elegantly
alecjacobson Nov 8, 2024
e4914ab
new
alecjacobson Nov 8, 2024
596ddea
don't return different types; wrappers dont return nb types
alecjacobson Nov 10, 2024
be0e9c0
more bindings
alecjacobson Nov 11, 2024
30d2ade
bunch more bindings
alecjacobson Nov 11, 2024
ddbab02
cgal, tetgen, triangle modules
alecjacobson Nov 11, 2024
f8a1e1f
more bindings
alecjacobson Nov 12, 2024
6d4854a
arap
alecjacobson Nov 12, 2024
4c13728
rm prints
alecjacobson Nov 12, 2024
62183ed
bunch more bindings; embree; enums; no mqwf class
alecjacobson Nov 18, 2024
6305f70
intrinsic stuff
alecjacobson Nov 18, 2024
85f5d3f
refactor tests
alecjacobson Nov 19, 2024
0e5e621
more bindings
alecjacobson Nov 23, 2024
6836453
list of priority bindings
alecjacobson Nov 27, 2024
7d757e0
bump libigl (cgal;boost)
alecjacobson Nov 27, 2024
b045174
10.5
alecjacobson Nov 27, 2024
483026a
tone down verbosity in hopes that link warning vomit goes away
alecjacobson Dec 6, 2024
c665a9e
rm constraints
alecjacobson Dec 6, 2024
caeef48
rm env
alecjacobson Dec 6, 2024
8a5681b
tone down output here too
alecjacobson Dec 6, 2024
e19d416
typing extensions
alecjacobson Dec 6, 2024
ac8fca0
numpy>1.20
alecjacobson Dec 6, 2024
4a73d55
test
alecjacobson Dec 6, 2024
f08c290
at least one
alecjacobson Dec 9, 2024
56d6625
switch to pure pyproject.toml
alecjacobson Jan 22, 2025
9a693de
scikit build core
alecjacobson Jan 22, 2025
5aacf3b
use nanobind_example wheels.yml
alecjacobson Jan 23, 2025
0a5671f
use dr jit wheels.yml
alecjacobson Jan 23, 2025
40b995a
use dr jit wheels.yml
alecjacobson Jan 23, 2025
e4cdf40
use dr jit wheels.yml
alecjacobson Jan 23, 2025
3c495f8
use dr jit wheels.yml
alecjacobson Jan 23, 2025
07cb740
pip too
alecjacobson Jan 23, 2025
61d33ed
compile just a single file
alecjacobson Jan 23, 2025
5610bab
tests
alecjacobson Jan 23, 2025
62f9705
naming convention
alecjacobson Jan 23, 2025
bec7428
try to use dependencies
alecjacobson Jan 23, 2025
f1d2b27
test nothing
alecjacobson Jan 23, 2025
0114f5c
3.10
alecjacobson Jan 23, 2025
e8af26b
simplify
alecjacobson Jan 23, 2025
9fd8504
3.10
alecjacobson Jan 23, 2025
0f16573
3.10
alecjacobson Jan 23, 2025
d357f6d
14
alecjacobson Jan 23, 2025
efceaa9
try to get the damn file
alecjacobson Jan 23, 2025
149bc9b
turn off repair
alecjacobson Jan 23, 2025
3668330
install
alecjacobson Jan 23, 2025
4ea33e9
restore
alecjacobson Jan 23, 2025
ff11f32
deploy
alecjacobson Jan 23, 2025
3a2c24a
15
alecjacobson Jan 23, 2025
353b5d7
15
alecjacobson Jan 23, 2025
1513cb9
10.15
alecjacobson Jan 23, 2025
e905830
15
alecjacobson Jan 23, 2025
7e0c3f6
cleanup
alecjacobson Jan 23, 2025
dd54eff
newer pythong
alecjacobson Jan 23, 2025
79a4e66
all 12
alecjacobson Jan 23, 2025
5236a7e
numpy dep
alecjacobson Jan 23, 2025
fe40913
11
alecjacobson Jan 23, 2025
ea21f33
preinstall numpy
alecjacobson Jan 23, 2025
ae8b2a6
preinstall numpy
alecjacobson Jan 23, 2025
38c775c
use matrix
alecjacobson Jan 23, 2025
b1e4499
name
alecjacobson Feb 1, 2025
d18a2d4
name
alecjacobson Feb 1, 2025
8b0bd7e
disable?
alecjacobson Feb 1, 2025
346baef
cpversion
alecjacobson Feb 1, 2025
3164a98
disable
alecjacobson Feb 1, 2025
ff06871
disable
alecjacobson Feb 1, 2025
fbfdcaf
auto64
alecjacobson Feb 1, 2025
0eba138
skip 32
alecjacobson Feb 1, 2025
71fb112
skip all musllinux
alecjacobson Feb 1, 2025
0566995
rm pytest from deps
alecjacobson Feb 1, 2025
57b9190
test AABB
alecjacobson Feb 1, 2025
aaf3632
version
alecjacobson Feb 1, 2025
428d60a
install
alecjacobson Feb 1, 2025
2a87174
add 'em all back
alecjacobson Feb 1, 2025
b582b2c
add back tests
alecjacobson Feb 1, 2025
db0689e
generic string
alecjacobson Feb 1, 2025
abf24d0
enable all submodules
alecjacobson Feb 1, 2025
f08c6f1
just import tetgen/triangle
alecjacobson Feb 2, 2025
e1c7983
all triangle and tetgen
alecjacobson Feb 2, 2025
8811c46
enable all tests
alecjacobson Feb 2, 2025
9c54a71
enable cgal and embree
alecjacobson Feb 2, 2025
25e2701
[ci skip] print build type
alecjacobson Feb 2, 2025
fff8d57
wip tests
alecjacobson Feb 2, 2025
0b98261
try to build all cpversions
alecjacobson Feb 2, 2025
fcbcbd1
Merge branch 'alecjacobson/nanobind' of github.com:libigl/libigl-pyth…
alecjacobson Feb 2, 2025
06db8d5
restore just 311
alecjacobson Feb 2, 2025
dfcd416
fix typo
alecjacobson Feb 2, 2025
f555b07
vesion only in pyproject; try to build 3.8 using old numpy
alecjacobson Feb 2, 2025
7465743
[ci skip] merge
alecjacobson Feb 2, 2025
5566d4d
old numpy for 3.8
alecjacobson Feb 2, 2025
2eb44d0
rm 38
alecjacobson Feb 2, 2025
fff4817
fail-fast false
alecjacobson Feb 2, 2025
df88d53
rm test_version
alecjacobson Feb 2, 2025
3b06a20
exclude 38-mac14
alecjacobson Feb 2, 2025
e161e29
just sdist
alecjacobson Feb 2, 2025
f74c61e
another try to get sdist
alecjacobson Feb 2, 2025
c713af7
restore pip workflow. rm 313 redundant
alecjacobson Feb 2, 2025
bc2cb76
[ci skip] note about version
alecjacobson Feb 2, 2025
a52175a
[ci skip] clearer readme
alecjacobson Feb 2, 2025
df09708
[ci skip] links
alecjacobson Feb 2, 2025
f75dad8
[ci skip] username links
alecjacobson Feb 2, 2025
e1b5034
[ci skip] wheel download instructions
alecjacobson Feb 2, 2025
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
38 changes: 38 additions & 0 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Pip

on:
workflow_dispatch:
pull_request:
push:
branches:
- master

jobs:
build:
name: Build with Pip
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]
python-version: ["3.10"]

steps:
- uses: actions/checkout@v4

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

- name: Set min macOS version
if: runner.os == 'macOS'
run: |
echo "MACOSX_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV

- name: Build and install
run: |
python -m pip install pytest
pip install --verbose .

- name: Test
run: python -m pytest
112 changes: 30 additions & 82 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Pip build
name: Wheels

on:
push:
branches:
branches:
- main
pull_request:
branches:
Expand All @@ -14,6 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Build SDist
run: pipx run build --sdist
Expand All @@ -23,102 +25,48 @@ jobs:

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

build_wheels:
name: Build wheels ${{ matrix.cpversion }}-${{ matrix.os.cibw-arch }}
runs-on: ${{ matrix.os.runs-on }}

env:
CIBW_BUILD_VERBOSITY: 3
# This is very dubious... It *may* work because these are just cpp libraries that should not depend on the python version. Still, super-dubious.
CIBW_TEST_REQUIRES: "gitpython"
CIBW_TEST_COMMAND: "python {project}/tests/test_basic.py"
CIBW_BUILD: "${{ matrix.cpversion }}-${{ matrix.os.cibw-arch }}"
CIBW_TEST_SKIP: "*-macosx_arm64"
CIBW_ENVIRONMENT: "MAX_JOBS=${{ matrix.os.runs-on == 'macos-latest' && 3 || 2 }} PIP_CONSTRAINT=constraints.txt"
# Why universal2 here? It's not included above in CIBW_BUILD
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"
CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=10.13 CMAKE_OSX_ARCHITECTURES=\"${{ matrix.os.cibw-arch == 'macosx_x86_64' && 'x86_64' || matrix.os.cibw-arch == 'macosx_arm64' && 'arm64' || matrix.os.cibw-arch == 'macosx_universal2' && 'arm64;x86_64' || '' }}\""

name: Build ${{ matrix.cpversion }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Launch separate job for each python. The build is so much longer than
# machine configuration/setup, so parallel builds will be faster. More
# importantly, github times out after 6 hours _per job_.
cpversion:
- cp36
- cp37
- cp38
- cp39
- cp310
- cp311
- cp312
os:
- runs-on: ubuntu-latest
cibw-arch: manylinux_x86_64
- runs-on: macos-latest
cibw-arch: macosx_x86_64
- runs-on: macos-latest
cibw-arch: macosx_arm64
- runs-on: windows-latest
cibw-arch: win_amd64
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14]
# cp313 seemed to produce the same wheel name as cp312. Skip unless
# necessary.
cpversion: [cp38, cp39, cp310, cp311, cp312]
# github actions cp38 on macos-14 runners are cross compiling or
# something and confusing the stub generation. Just skip it for now.
# Maybe it'd be friendlier to disable the stub generation for this
# combination.
exclude:
- cpversion: cp36
os:
runs-on: macos-latest
cibw-arch: macosx_arm64
- cpversion: cp37
os:
runs-on: macos-latest
cibw-arch: macosx_arm64
- os: macos-14
cpversion: cp38


steps:
- uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
- uses: actions/setup-python@v5
with:
python-version: "3.x"
python-version: '3.12'

- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel
run: python -m pip install cibuildwheel==2.22.0

- name: Build wheels
shell: bash
run: |
PIP_CONSTRAINT=$GITHUB_WORKSPACE/constraints.txt python -m cibuildwheel --output-dir wheelhouse
# why do I need to specify this cpversion here?
env:
CIBW_ARCHS: "auto64"
CIBW_BUILD: "${{ matrix.cpversion }}-*"
# why isn't auto64 working?
CIBW_SKIP: "cp*-manylinux_i686 cp*-musllinux* cp*-win32"
run: python -m cibuildwheel --output-dir wheelhouse

# Upload binaries to github
- uses: actions/upload-artifact@v4
with:
name: artifact-wheel-${{ matrix.cpversion }}-${{ matrix.os.cibw-arch }}
path: |-
./wheelhouse/*.whl
./wheelhouse/*.tar.gz

# # Push the resulting binaries to pypi on a tag starting with 'v'
upload_pypi:
needs: build_wheels
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
pattern: artifact-*
merge-multiple: true
path: dist

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}
skip_existing: true
# To test: repository_url: https://test.pypi.org/legacy/
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ junit
.*.swo
*~
dist/
igl/*
Loading