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

Feature: Add wheel uploads to GitHub actions #4

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
dfc4283
Update ci.yaml
MAminSFV Sep 14, 2024
5affe41
Update ci.yaml
MAminSFV Sep 14, 2024
b178746
Update ci.yaml
MAminSFV Sep 14, 2024
262995b
Update pyproject.toml
MAminSFV Sep 14, 2024
c272ea3
Update pyproject.toml
MAminSFV Sep 14, 2024
cabe261
Separate workflows
MAminSFV Sep 14, 2024
9f9a72a
Create wheels.yaml
MAminSFV Sep 14, 2024
340b40d
new workflows split
MAminSFV Sep 14, 2024
f110c75
Update wheels.yaml
MAminSFV Sep 14, 2024
2987696
Update wheels.yaml
MAminSFV Sep 14, 2024
68fb581
Update wheels.yaml
MAminSFV Sep 14, 2024
e80997c
Update pyproject.toml
MAminSFV Sep 14, 2024
ae130b4
Ditch ciwheels
MAminSFV Sep 14, 2024
596dc13
Refactor
MAminSFV Sep 14, 2024
99e07a5
Update wheels.yaml
MAminSFV Sep 14, 2024
3aba91c
Update wheels.yaml
MAminSFV Sep 14, 2024
5094077
Update wheels.yaml
MAminSFV Sep 14, 2024
a11ba8b
Update wheels.yaml
MAminSFV Sep 14, 2024
8a34b7b
Update wheels.yaml
MAminSFV Sep 14, 2024
f10bd09
Update wheels.yaml
MAminSFV Sep 14, 2024
87db996
Update wheels.yaml
MAminSFV Sep 14, 2024
fceeb31
Update wheels.yaml
MAminSFV Sep 14, 2024
c38d23b
Update wheels.yaml
MAminSFV Sep 14, 2024
10cc3a9
refactor
MAminSFV Sep 14, 2024
2bf073e
Update pyproject.toml
MAminSFV Sep 14, 2024
9c4591f
fix syntax
MAminSFV Sep 14, 2024
d3c7647
Update pyproject.toml
MAminSFV Sep 14, 2024
8119a89
Update pyproject.toml
MAminSFV Sep 14, 2024
0560691
Update setup_ubuntu
MAminSFV Sep 14, 2024
4faa7e6
Update wheels.yaml
MAminSFV Sep 14, 2024
2aa420b
Update pyproject.toml
MAminSFV Sep 14, 2024
c658527
Update pyproject.toml
MAminSFV Sep 14, 2024
ae807ae
Update pyproject.toml
MAminSFV Sep 14, 2024
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
42 changes: 42 additions & 0 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
@@ -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'
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
]
Expand Down Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup_ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
ca-certificates
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ def build_extension(self, ext: CMakeExtension) -> 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",
)
Loading