Skip to content

Commit 9d77f5a

Browse files
committed
Get pin from pypi
1 parent 01a27f5 commit 9d77f5a

3 files changed

Lines changed: 44 additions & 2 deletions

File tree

.github/scripts/repair_wheel.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
# Repair a wheel with auditwheel, excluding the pinocchio ecosystem shared
3+
# libraries. These are provided at runtime by the "pin" PyPI package and must
4+
# not be bundled into the wheel.
5+
#
6+
# Usage: repair_wheel.sh <wheel> <dest_dir>
7+
set -euxo pipefail
8+
9+
WHEEL="$1"
10+
DEST_DIR="$2"
11+
CONDA_ENV="/opt/cibw_env"
12+
13+
# Build --exclude flags for every pinocchio-ecosystem .so in the conda env.
14+
# Everything else (yaml-cpp, osqp, toppra, roboplan sub-packages, etc.) is
15+
# bundled normally by auditwheel.
16+
EXCLUDES=$(find "$CONDA_ENV/lib" -maxdepth 1 \
17+
\( \
18+
-name "libpinocchio*.so*" \
19+
-o -name "libcoal*.so*" \
20+
-o -name "libhpp-fcl*.so*" \
21+
-o -name "liburdfdom*.so*" \
22+
-o -name "libconsole_bridge*.so*" \
23+
-o -name "libassimp*.so*" \
24+
-o -name "libboost*.so*" \
25+
-o -name "libcasadi*.so*" \
26+
-o -name "liboctomap*.so*" \
27+
-o -name "liboctomath*.so*" \
28+
\) \
29+
-printf "--exclude %f\n" 2>/dev/null \
30+
| sort -u | tr '\n' ' ')
31+
32+
echo "Pinocchio ecosystem excluded from bundling: $EXCLUDES"
33+
# shellcheck disable=SC2086
34+
auditwheel repair -w "$DEST_DIR" $EXCLUDES "$WHEEL"

bindings/pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ authors = [
1414
classifiers = [
1515
"License :: OSI Approved :: MIT License",
1616
]
17+
dependencies = [
18+
"pin>=3.9.0,<4",
19+
]
1720

1821
[project.urls]
1922
Homepage = "https://github.com/sea-bass/roboplan"
@@ -46,9 +49,9 @@ build-dir = "build/{wheel_tag}"
4649
# ---------------------------------------------------------------------------
4750
[tool.cibuildwheel]
4851
build = ["cp310-manylinux_x86_64"]
49-
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_39_x86_64"
52+
manylinux-x86_64-image = "manylinux_2_28"
5053
before-all = "bash {project}/.github/scripts/build_roboplan_deps.sh {project}"
51-
repair-wheel-command = "auditwheel show {wheel}; auditwheel repair -w {dest_dir} {wheel}"
54+
repair-wheel-command = "bash /project/.github/scripts/repair_wheel.sh {wheel} {dest_dir}"
5255

5356
[tool.cibuildwheel.environment]
5457
CMAKE_PREFIX_PATH = "/opt/roboplan_deps:/opt/cibw_env"

bindings/src/roboplan/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# This permits the modules to be used as, e.g.,
22
# from roboplan.core import Box
33
import sys
4+
5+
# Load pinocchio's shared libraries before the extension so the dynamic linker
6+
# can resolve them at runtime. pinocchio is provided by the "pin" package.
7+
import pinocchio # noqa: F401
8+
49
from .roboplan_ext import __version__
510
from .roboplan_ext import core as _core
611
from .roboplan_ext import example_models as _example_models

0 commit comments

Comments
 (0)