-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from alecjacobson/master
Set up CIBuildWheels for pip install ; cmake cleanup
- Loading branch information
Showing
19 changed files
with
264 additions
and
10,938 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
skip_existing: true | ||
# To test: repository_url: https://test.pypi.org/legacy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.