diff --git a/docker/manylinux2014/config/eigenpy/setup.py b/docker/manylinux2014/config/eigenpy/setup.py index 88628ac61829655acac764d630284572082323e1..028c0a2e8baac9c275adf49c3872b61c1ee69c13 100644 --- a/docker/manylinux2014/config/eigenpy/setup.py +++ b/docker/manylinux2014/config/eigenpy/setup.py @@ -8,7 +8,7 @@ except FileNotFoundError: setup( name="eigenpy", - version="2.5.0", + version="VERSION", description="Bindings between Numpy and Eigen using Boost.Python", long_description=long_description, long_description_content_type="text/markdown", diff --git a/docker/manylinux2014/config/hpp-fcl/setup.py b/docker/manylinux2014/config/hpp-fcl/setup.py index 4dd69415a8bc364a788bb8d7c5ac800e935ecee9..0a852d47cdd63d1b0b5aef873f25b9135717700a 100644 --- a/docker/manylinux2014/config/hpp-fcl/setup.py +++ b/docker/manylinux2014/config/hpp-fcl/setup.py @@ -8,7 +8,7 @@ except FileNotFoundError: setup( name="hpp-fcl", - version="1.6.0", + version="VERSION", description="HPP fork of FCL -- The Flexible Collision Library", long_description=long_description, long_description_content_type="text/markdown", diff --git a/docker/manylinux2014/config/pinocchio/setup.py b/docker/manylinux2014/config/pinocchio/setup.py index ac8487b9aacd4837237d76830c7ab8f45dedfdf7..a215ee777db8c2a8577014d1488f82c175a993dd 100644 --- a/docker/manylinux2014/config/pinocchio/setup.py +++ b/docker/manylinux2014/config/pinocchio/setup.py @@ -8,7 +8,7 @@ except FileNotFoundError: setup( name="pinocchio", - version="2.5.0", + version="VERSION", description="A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives", long_description=long_description, long_description_content_type="text/markdown", diff --git a/docker/manylinux2014/scripts/build_wheels.sh b/docker/manylinux2014/scripts/build_wheels.sh index 24a88711677c1368c84ebf9f9e152925868f7ddd..d4df0b72d23e9125d980ac39ebc98260b0f76f26 100755 --- a/docker/manylinux2014/scripts/build_wheels.sh +++ b/docker/manylinux2014/scripts/build_wheels.sh @@ -3,13 +3,13 @@ TARGET=${1:-eigenpy} PYVER=${2:-3.9} -VERSION="$(grep version "/io/config/$TARGET/setup.py" | head -1 | cut -d'"' -f2)" +export CMAKE_PREFIX_PATH="~/.local:/opt/openrobots" +VERSION="$(grep version setup.py | head -1 | cut -d'"' -f2)" TARVER="$TARGET-$VERSION" WHEEL_DIR="${TARGET/-/_}-$VERSION" PACKAGE="$TARGET" [ "$TARGET" = "hpp-fcl" ] && PACKAGE=hppfcl PYBIN="$(find /opt/python -name "cp${PYVER/.}*")/bin" -export CMAKE_PREFIX_PATH="~/.local:/opt/openrobots" INSTALLED_PREFIX="$PWD/_skbuild/linux-x86_64-$PYVER/cmake-install" SITE_PACKAGES="lib/python$PYVER/site-packages" USER_PACKAGES="$HOME/.local/$SITE_PACKAGES" @@ -19,7 +19,7 @@ PACKAGE_DIR="$WHEEL_DIR/$WHEEL_DIR.data/data/$SITE_PACKAGES/$PACKAGE" # Install dependencies "$PYBIN/pip" install --user --find-links=/io/dist/ \ - $(grep install_requires "/io/config/$TARGET/setup.py" | sed "s/.*\['//;s/'\].*//;s/,//") + $(grep install_requires setup.py | sed "s/.*\['//;s/'\].*//;s/,//") # Build wheels "$PYBIN/python" setup.py bdist_wheel -j"$(nproc)" -DBUILD_TESTING=OFF -DINSTALL_DOCUMENTATION=OFF \ @@ -54,7 +54,7 @@ for lib in "$WHEEL_DIR/${LIB_DIR}"/* do patchelf --set-rpath '$ORIGIN' "$lib" done -# .cmake files should not have references to _skbuild +# fix .cmake files: remove _skbuild references & update lib name with their hash from auditwheel MAIN_LIB=$(find "$WHEEL_DIR/$LIB_DIR" -name "lib$TARGET-*.so") # eigenpy-2.5.0/eigenpy.libs/libeigenpy-0c5e8890.so MAIN_LIB_NAME=$(basename "$MAIN_LIB") # libeigenpy-0c5e8890.so MAIN_LIB_NAME_NO_HASH=$(echo "$MAIN_LIB_NAME" | sed 's/-[[:xdigit:]]\{8\}//') # libeigenpy.so diff --git a/docker/manylinux2014/scripts/patch_whitelist.py b/docker/manylinux2014/scripts/patch_whitelist.py index 2ca35266edb5864cfe2ef00555899aa61c1e1062..03cf15152e99e397889cacc7a11dd3851fa0e527 100755 --- a/docker/manylinux2014/scripts/patch_whitelist.py +++ b/docker/manylinux2014/scripts/patch_whitelist.py @@ -13,14 +13,13 @@ from pathlib import Path import auditwheel -USER_PACKAGES = Path(sys.argv[-1]) POLICY = Path(auditwheel.__file__).parent / 'policy/policy.json' with POLICY.open() as f: policies = json.load(f) deps = [] -for dep in USER_PACKAGES.glob('*.libs'): +for dep in Path(sys.argv[-1]).glob('*.libs'): deps.append(dep.name) for lib in dep.glob('*.so*'): policies[-1]["lib_whitelist"].append(lib.name) diff --git a/docker/manylinux2014/scripts/setup.sh b/docker/manylinux2014/scripts/setup.sh index f5bfb38f61576921caf1b08c921a3c9d794953ee..3f3afb0e5213c8e2619ec3a024f1fc920dbc34f8 100755 --- a/docker/manylinux2014/scripts/setup.sh +++ b/docker/manylinux2014/scripts/setup.sh @@ -4,7 +4,7 @@ TARGET=${1:-eigenpy} PYVER=${2:-3.9} URL="$(grep url "/io/config/$TARGET/setup.py" | cut -d'"' -f2)" -VERSION="$(grep version "/io/config/$TARGET/setup.py" | head -1 | cut -d'"' -f2)" +VERSION="$(curl -sSL "$(echo $URL | sed 's:github.com:api.github.com/repos:')/releases/latest" | grep tag_name | sed 's/[^.0-9]//g')" mkdir -p /io/wheelhouse [ "$(ls -A /io/wheelhouse)" ] && { echo "./wheelhouse should be empty before running this script."; exit; } @@ -15,6 +15,8 @@ curl -sSL "$URL/releases/download/v$VERSION/$TARGET-$VERSION.tar.gz" \ cp "/io/config/$TARGET/setup.py" . cp /scripts/pyproject.toml . +sed -i "s/VERSION/$VERSION/" setup.py + # Fix CMake for scikit-build find . -name CMakeLists.txt | xargs sed -i 's/PYTHON_INCLUDE_DIRS/PYTHON_INCLUDE_DIR/' sed -i 's/REQUIRED COMPONENTS Interpreter Development/REQUIRED COMPONENTS Interpreter/' cmake/python.cmake