diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml new file mode 100644 index 0000000..ae0048f --- /dev/null +++ b/.github/workflows/wheels.yaml @@ -0,0 +1,42 @@ +name: Build Wheels + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build_wheels: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Initial Setup + run: sudo bash ./scripts/setup_ubuntu + + - name: Build wheels + run: | + pip3 install cibuildwheel + cibuildwheel --output-dir ./wheels/ + + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: drake_extension_jammy_py310.whl + path: wheels/*.whl + + test_wheels: + needs: build_wheels + runs-on: ubuntu-22.04 + steps: + - uses: actions/download-artifact@v4 + with: + name: drake_extension_jammy_py310.whl + - name: Display structure of downloaded files + run: ls -R + - name: Install and test + run: | + pip3 install ./drake_extension-0.0.1-cp310-cp310-linux_x86_64.whl + python3 -c 'import drake_extension' diff --git a/pyproject.toml b/pyproject.toml index f905ea0..a26c73b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ name = "drake_extension" version = "0.0.1" description = "An example minimal project that compiles bindings using Pybind and scikit-build" readme = "README.md" -requires-python = ">=3.10" +requires-python = "==3.10" authors = [ { name = "M. Amin Safavi", email = "safavi.m.amin@gmail.com" } ] @@ -40,17 +40,18 @@ filterwarnings = [ ] testpaths = ["tests"] - [tool.cibuildwheel] -build-frontend = "build[uv]" +build = "cp310-manylinux_x86_64" test-command = "pytest {project}/tests" test-extras = ["test"] +test-skip = ["*universal2:arm64"] +# Setuptools bug causes collision between pypy and cpython artifacts before-build = "rm -rf {project}/build" +before-all = ['export PATH="/opt/drake/bin${PATH:+:${PATH}}"', + 'export PYTHONPATH="/opt/drake/lib/python3.10/site-packages${PYTHONPATH:+:${PYTHONPATH}}"', + 'export LD_LIBRARY_PATH="/opt/drake/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"'] +environment-pass = ["PATH", "PYTHONPATH", "LD_LIBRARY_PATH"] -[tool.cibuildwheel.pyodide] -environment.CFLAGS = "-fexceptions" -environment.LDFLAGS = "-fexceptions" -build-frontend = {name = "build", args = ["--exports", "whole_archive"]} [tool.ruff] src = ["src"] diff --git a/scripts/setup_ubuntu b/scripts/setup_ubuntu index 7a3976c..9bdd35a 100644 --- a/scripts/setup_ubuntu +++ b/scripts/setup_ubuntu @@ -3,7 +3,7 @@ set -euxo pipefail export DEBIAN_FRONTEND=noninteractive - +apt install apt apt-get update apt-get install --no-install-recommends -y $(cat < None: ext_modules=[CMakeExtension("drake_extension")], cmdclass={"build_ext": CMakeBuild}, zip_safe=False, - extras_require={"test": ["pytest>=6.0"], - "pydrake": ["pydrake>=1.20"]}, + extras_require={"test": ["pytest>=6.0"]}, python_requires=">=3.10", )