Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
3793e22
add wheels action
Jan 21, 2023
9da41f1
missing pyproject.toml
Jan 21, 2023
adaab4d
rm everything but one file
Jan 21, 2023
222f978
Update wheels.yml
alecjacobson Jan 21, 2023
125f46e
typo
Jan 21, 2023
5b3ec91
omg another typo
Jan 21, 2023
b633d0e
skip 3.6
Jan 22, 2023
c2ef542
skip clean dir step
Jan 22, 2023
ac51051
skip more (scipy)
Jan 22, 2023
74fe375
change name to practice name (delete tutorial)
Jan 24, 2023
5c1efda
attempt to bump to os11 to get arm to build
Jan 24, 2023
9ece92a
use gpytoolbox style matrix
Jan 24, 2023
a086356
typo
Jan 24, 2023
b2b9215
try just arm64
Jan 24, 2023
e79a834
bump version; x86_64 universal
Jan 24, 2023
da2a896
more elaborate wheels
Jan 24, 2023
4fffb72
more more elaborate wheels
Jan 24, 2023
0216365
more more elaborate wheels
Jan 24, 2023
ad913d1
replace with gpytoolbox's entire script
alecjacobson Jan 24, 2023
8ee4b05
replace with gpytoolbox's entire script
alecjacobson Jan 24, 2023
4928062
SKIP and just linux
alecjacobson Jan 24, 2023
9a3aeab
just intel mac
alecjacobson Jan 24, 2023
ad1f941
rm classes
alecjacobson Jan 24, 2023
32c9b07
just arm
alecjacobson Jan 24, 2023
f63c849
bump cibw version
alecjacobson Jan 24, 2023
529f3a3
rm numpy installs
alecjacobson Jan 24, 2023
ac1ecd0
build sdist as separate job
alecjacobson Jan 24, 2023
e38a961
restore other builds
alecjacobson Jan 24, 2023
b7d0992
No module named delvewheel
alecjacobson Jan 24, 2023
4a2c5c0
restore classes
Jan 24, 2023
6737065
bump version
Jan 24, 2023
8b00a12
change name to libigl; version to 0.0.1
Jan 24, 2023
150e341
Update __init__.py
alecjacobson Jan 24, 2023
dacec1d
Update _version.py
alecjacobson Jan 25, 2023
da72146
restore cpp files
Jan 25, 2023
28df393
bump version
Jan 25, 2023
3ba54e4
ignore vim backup files
Jan 25, 2023
3aef11f
restore tutorial
Jan 25, 2023
b17b722
ignore 🥚ℹ️ [skip ci]
Jan 25, 2023
0a67380
update readme to ref pip [skip ci]
Jan 25, 2023
bf6cc1b
no longer new [skip ci]
Jan 25, 2023
59f9d8b
pypi badge [ci skip]
Feb 1, 2023
bec409a
Merge branch 'master' of https://github.com/libigl/libigl-python-bind…
Feb 1, 2023
740f87b
match version on libigl commit (+0.0.1 to indicate slightly beyond 2.…
Feb 1, 2023
9d74b5c
add tests
Feb 1, 2023
0215287
clean up cmake mess
Feb 1, 2023
5e0f474
bump min cmake to avoid ironic warning in warnings file
Feb 1, 2023
e2bb4a5
numpyeigen's special fetch
Feb 1, 2023
ebabced
numpy eigen still confused
Feb 1, 2023
301d01a
fix test to take data path optional arg
Feb 1, 2023
f1b4ee8
skip arm test explicitly since it is anyway [ci skip]
Feb 1, 2023
ebaeeaf
aaaaahhhh one stupid hardcoded path
Feb 1, 2023
cdaa3b5
github actions is driving me nuts
Feb 2, 2023
6ba2af2
MAX_JOBS=2
Feb 2, 2023
4c41983
Merge pull request #1 from alecjacobson/alecjacobson/cleanup-cmake [c…
alecjacobson Feb 2, 2023
624028e
only build 311
Feb 2, 2023
b61ad39
really only 311
alecjacobson Feb 2, 2023
057275b
works on elf
alecjacobson Feb 2, 2023
143be7c
revert to MAX_JOBS=2
alecjacobson Feb 2, 2023
b045698
Restore other builds [ci skip]
alecjacobson Feb 2, 2023
c3954ff
Merge pull request #2 from alecjacobson/alecjacobson/cp311
alecjacobson Feb 2, 2023
7d70a8b
delete everything
Feb 3, 2023
1f6932f
reduce to single file
Feb 3, 2023
0701e38
remove lines I dont think are doing anything
Feb 3, 2023
e27e76e
hmm some of those seemed important
Feb 3, 2023
e2e820b
augh just arm then
Feb 3, 2023
43e5691
move to matrix
Feb 3, 2023
37312b1
try to move another line
Feb 3, 2023
626d972
skip win32 line
Feb 3, 2023
89e6000
i dont like that line
Feb 3, 2023
4ed3438
remove configure
Feb 3, 2023
8933e1c
remove sdist
Feb 3, 2023
27f4407
just 38
Feb 3, 2023
821be53
augh I guess that line matters
Feb 3, 2023
374a1c4
39
Feb 3, 2023
2bb17fb
matrix jobs
Feb 3, 2023
a333311
enable all jobs (still no test)
Feb 3, 2023
7afc512
no win (matrix bug?)
Feb 3, 2023
2930971
paied values
Feb 3, 2023
8a93872
missing brace
Feb 3, 2023
9cd7b78
exclude old python on young mac
Feb 3, 2023
4062f56
add back files and tests
Feb 3, 2023
80c67ef
add back missing ddm function
Feb 3, 2023
8cfb43c
Merge pull request #3 from alecjacobson/alecjacobson/split-up-builds
alecjacobson Feb 3, 2023
65d4a02
Merge branch 'master' into master
alecjacobson Feb 5, 2023
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
109 changes: 109 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Pip build

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

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

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

- name: Check metadata
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz

build_wheels:
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"]
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} ]
exclude:
- os: { runs-on: macos-latest, cibw-arch: macosx_arm64}
cpversion: "cp36"
- os: { runs-on: macos-latest, cibw-arch: macosx_arm64}
cpversion: "cp37"



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_BEFORE_BUILD_WINDOWS: "python -m pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "python -m delvewheel repair --no-mangle-all --add-path build\\temp.win-amd64-3.6\\Release;build\\temp.win-amd64-3.6\\Release\\Release;build\\temp.win-amd64-3.6\\Release\\_deps\\gmp-src\\lib;build\\temp.win-amd64-3.6\\Release\\_deps\\mpfr-src\\lib -w {dest_dir} {wheel} "
CIBW_TEST_COMMAND: "python {project}/tests/test_basic.py {project}/data/"
CIBW_BUILD: "${{ matrix.cpversion }}-${{ matrix.os.cibw-arch }}"
CIBW_TEST_SKIP: "*-macosx_arm64"
CIBW_ENVIRONMENT: "MAX_JOBS=2"
# Why universal2 here? It's not included above in CIBW_BUILD
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"
CIBW_ENVIRONMENT_MACOS: "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' || '' }}\""


steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'

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

- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse

# Upload binaries to github
- uses: actions/upload-artifact@v2
with:
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@v2
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.pypi_password }}
skip_existing: true
# To test: repository_url: https://test.pypi.org/legacy/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pyigl_classes.cpython*
__pycache__

igl.egg-info
libigl.egg-info
*.code-workspace
out.obj
test.off
Expand All @@ -36,3 +37,4 @@ junit
.*.un~
.*.swp
.*.swo
*~
36 changes: 9 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,18 @@ include(Warnings)
# Use C++11/14
include(CXXFeatures)

option(PY_IGL_PYTHON_TESTS "Run Python tests" ON)
option(PY_IGL_DOWNLOAD_TEST_DATA "Download test data" ON)
option(PY_IGL_DOWNLOAD_TUTORIAL_DATA "Download tutorial data" ON)

# Generate position independent code by default
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE INTERNAL "")

include(PyiglDependencies)

if(NOT TARGET igl::core)
include(libigl)
endif()

# NumpyEigen
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PYLIBIGL_EXTERNAL}/numpyeigen/cmake)
# Generate position independent code by default
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
include(numpyeigen)

# A module for writing bindings with our framework
file(GLOB PYIGL_SOURCES src/*.cpp)

Expand All @@ -52,25 +50,9 @@ target_include_directories(pyigl_classes PRIVATE "${PYLIBIGL_EXTERNAL}/numpyeige
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
foreach(config ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${config} config)
string(REPLACE /MD /MT CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_${config}}")
foreach(config ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${config} config)
string(REPLACE /MD /MT CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_${config}}")
string(REPLACE /MD /MT CMAKE_CXX_FLAGS_${config} "${CMAKE_CXX_FLAGS_${config}}")
# LIST(APPEND CMAKE_CXX_FLAGS_${config} "/Zm")
endforeach()
endif()

# set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6)
# find_package(PythonLibs REQUIRED)
# find_package(PythonInterp REQUIRED)
# target_link_libraries(pyigl PRIVATE ${PYTHON_LIBRARIES})
# set_target_properties(pyigl PROPERTIES LINK_FLAGS "-Wl,-undefined,error")
#set_target_properties(pyigl PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
# set_target_properties(pyigl PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -msse2")
# set_target_properties(pyigl PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/igl")

if(${PY_IGL_PYTHON_TESTS})
pyigl_download_test_data()
enable_testing()
add_subdirectory(tests)
endforeach()
endif()
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,55 @@
# libigl Python Bindings
[![PyPI version](https://badge.fury.io/py/libigl.svg)](https://badge.fury.io/py/libigl)
[![Build Status](https://travis-ci.com/libigl/libigl-python-bindings.svg?branch=master)](https://travis-ci.com/libigl/libigl-python-bindings)
[![Build Status](https://dev.azure.com/libigl/Libigl/_apis/build/status/libigl.libigl-python-bindings?branchName=master)](https://dev.azure.com/libigl/Libigl/_build/latest?definitionId=1&branchName=master)

This repository contains the source code for the new and improved LibIGL Python bindings. These bindings are fully compatible with NumPy and SciPy and offer a convenient interface similar to functions in those libraries.
This repository contains the source code for the libigl Python bindings. These bindings are fully compatible with NumPy and SciPy and offer a convenient interface similar to functions in those libraries.

These bindings are still under active development and should still be considered alpha quality. We encourage users to post issues so we can improve the bindings!

## Installation

### With Conda (Recommended)
The simplest and best way to install the new LibIGL Python bindings is to run:
```
conda install -c conda-forge igl
python -m pip install libigl
```

### Compile from scratch (Not recommended)
If you wish to install the current master branch, you can compile the library from scratch, you can clone this repository and run the following command from the main directory:
If you wish to install the current development code, you can compile the library from scratch. Clone this repo and issue

```
python setup.py install
python -m pip install ./
```

**NOTE:** We will not provide support for installations done in this way, since there is a lot of variation between systems. For a consistent experience, use conda.

## [Help/Documentation](https://libigl.github.io/libigl-python-bindings/)
* A *temporary* tutorial on how to use the bindings can be found [here](https://libigl.github.io/libigl-python-bindings/tutorials/)
* A *temporary* function reference can be found [here](https://libigl.github.io/libigl-python-bindings/igl_docs/)

* A tutorial on how to use the bindings can be found [here](https://libigl.github.io/libigl-python-bindings/tutorials/)
* A function reference can be found [here](https://libigl.github.io/libigl-python-bindings/igl_docs/)

## Compiling and modifying the bindiings
After installing numpy & scipy and then cloning this repository, you can compile the bindings from scratch by running:

```
python setup.py develop
```

or

```
python setup.py build --debug develop
```
for debug compilation.

The above command will make the package `igl` available for import in the current shell.
for debug compilation. This command will make the package `igl` available for import in the
current shell.

To run the tests:

```
python setup.py test
```

or

```
python tests/test_basic.py
```

17 changes: 0 additions & 17 deletions cmake/DownloadProject.CMakeLists.cmake.in

This file was deleted.

Loading