Skip to content

Commit

Permalink
ci/linux: build wheels using cibuildwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
fabinsch committed Mar 6, 2023
1 parent 06ed466 commit 285e1db
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 12 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release on PyPI [Linux]

on:
pull_request:
release:
types:
- published

jobs:
build-wheel:
name: "Build ubuntu wheels"
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: python -m pip install -U pip
- run: python -m pip install cibuildwheel
- run: touch setup.py
- run: python -m cibuildwheel --output-dir wh
env:
CIBW_BUILD: cp37-*manylinux*_x86_64 cp38-*manylinux*_x86_64 cp39-*manylinux*_x86_64 cp310-*manylinux*_x86_64 cp311-*manylinux*_x86_64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_REPAIR_WHEEL_COMMAND: ""

- uses: actions/upload-artifact@v3
with:
path: wh

release:
needs: "build-wheel"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: actions/download-artifact@v3

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: |
github.repository == 'Simple-Robotics/proxsuite' &&
(github.event_name == 'release' && github.event.action == 'published')
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release on GitHub & PyPI
name: Release on PyPI [Windows, Mac]

on:
pull_request:
Expand All @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, self-hosted-arm64, windows-2019, windows-latest]
os: [macos-latest, self-hosted-arm64, windows-2019, windows-latest]
include:
- os: windows-2019
toolset: ClangCl
Expand All @@ -23,10 +23,6 @@ jobs:
- os: self-hosted-arm64
python-version: 3.7
steps:
- name: Set docker for linux
if: contains(matrix.os, 'ubuntu')
uses: docker://quay.io/pypa/manylinux_2_24_x86_64

- uses: actions/checkout@v2
with:
submodules: recursive
Expand All @@ -39,7 +35,7 @@ jobs:
git submodule update
- name: Setup conda
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
Expand All @@ -49,23 +45,23 @@ jobs:
activate-environment: proxsuite

- name: Install dependencies [Conda]
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
shell: bash -l {0}
run: |
# Workaround for https://github.com/conda-incubator/setup-miniconda/issues/186
conda config --remove channels defaults
mamba install doxygen graphviz eigen simde cmake compilers
- name: Print environment [Conda]
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
shell: bash -l {0}
run: |
conda info
mamba list
env
- name: Build wheel
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')
if: contains(matrix.os, 'macos')
shell: bash -l {0}
run: |
pip wheel . -w dist
Expand Down
2 changes: 2 additions & 0 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
set(PYTHON_COMPONENTS Development.Module)

include(../../cmake-module/python.cmake)

findpython(REQUIRED Development.Module)
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ description = "Quadratic Programming Solver for Robotics and beyond."
readme = "README.md"
requires-python = ">= 3.7"
license = "BSD-2-Clause"
dependencies = ["numpy","scipy"]
dependencies = ["numpy","scipy","cmeel-simde"]

[project.urls]
homepage = "https://github.com/Simple-Robotics/proxsuite"
repository = "https://github.com/Simple-Robotics/proxsuite.git"
changelog = "https://github.com/Simple-Robotics/proxsuite/CHANGELOG.md"

[build-system]
requires = ["cmeel[build]"]
requires = [
"cmeel[build]",
"cmeel-eigen",
"cmeel-simde",
]
build-backend = "cmeel.build"
configure-args = ["-DBUILD_TESTING:BOOL=OFF","-DBUILD_PYTHON_INTERFACE:BOOL=ON","-DBUILD_WITH_VECTORIZATION_SUPPORT:BOOL=ON","-DINSTALL_DOCUMENTATION:BOOL=OFF"]

0 comments on commit 285e1db

Please sign in to comment.