Skip to content

Commit

Permalink
Fix Python wheels missing constrained planning components (#1159)
Browse files Browse the repository at this point in the history
* Install numpy before building Boost in CI

* Make binding generation exceptions less silent

* Update versions of actions for Python wheel CI
  • Loading branch information
wbthomason committed May 3, 2024
1 parent 632a350 commit 7f30de1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/before_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ install_boost() {
# multiple on the host system.
python_include_path=$(python3 -c "from sysconfig import get_paths as gp; print(gp()['include'])")
echo "using python : ${python_version} : : ${python_include_path} ;" > "$HOME/user-config.jam"

pip3 install numpy
./bootstrap.sh
sudo ./b2 "${b2_args[@]}" \
--with-serialization \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
submodules: 'recursive'

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.1
uses: pypa/cibuildwheel@v2.17.0
with:
package-dir: py-bindings
env:
Expand All @@ -33,7 +33,7 @@ jobs:
CIBW_BUILD: cp3{10,11,12}-macosx_{x86_64,arm64} cp3{7,8,9,10,11,12}-manylinux_x86_64
CIBW_BUILD_VERBOSITY: 1

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheels
path: wheelhouse
Expand Down
6 changes: 5 additions & 1 deletion py-bindings/generate_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,9 @@ def filter_declarations(self):
try:
# create a python type for each of their corresponding state types
state = self.ompl_ns.class_('ScopedState< ompl::base::%sStateSpace >' % stype)
except:
except Exception as e:
# ignore errors because of missing Boost.Numpy
print(f"Ignoring error due to missing Boost.Numpy: {e}")
continue
state.rename(stype+'State')
state.operator('=', arg_types=['::ompl::base::State const &']).exclude()
Expand Down Expand Up @@ -355,6 +356,7 @@ def filter_declarations(self):
try:
cls.member_function(method, arg_types=[signature, None]).add_transformation(FT.input(0))
except Exception as e:
print(f"Ignoring constraint signature rewrite exception: {e}")
pass

cls = self.ompl_ns.class_('Constraint')
Expand All @@ -364,9 +366,11 @@ def filter_declarations(self):
try:
cls.member_function(method, arg_types=[signature]).add_transformation(FT.input(0))
except Exception as e:
print(f"Ignoring constraint signature rewrite exception: {e}")
pass

except Exception as e:
print(f"Ignoring generation exception: {e}")
pass

# Exclude PlannerData::getEdges function that returns a map of PlannerDataEdge* for now
Expand Down

0 comments on commit 7f30de1

Please sign in to comment.