Skip to content
Snippets Groups Projects
Commit a482fc17 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

get version from github api

parent 9e077636
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ except FileNotFoundError: ...@@ -8,7 +8,7 @@ except FileNotFoundError:
setup( setup(
name="eigenpy", name="eigenpy",
version="2.5.0", version="VERSION",
description="Bindings between Numpy and Eigen using Boost.Python", description="Bindings between Numpy and Eigen using Boost.Python",
long_description=long_description, long_description=long_description,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
......
...@@ -8,7 +8,7 @@ except FileNotFoundError: ...@@ -8,7 +8,7 @@ except FileNotFoundError:
setup( setup(
name="hpp-fcl", name="hpp-fcl",
version="1.6.0", version="VERSION",
description="HPP fork of FCL -- The Flexible Collision Library", description="HPP fork of FCL -- The Flexible Collision Library",
long_description=long_description, long_description=long_description,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
......
...@@ -8,7 +8,7 @@ except FileNotFoundError: ...@@ -8,7 +8,7 @@ except FileNotFoundError:
setup( setup(
name="pinocchio", name="pinocchio",
version="2.5.0", version="VERSION",
description="A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives", description="A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives",
long_description=long_description, long_description=long_description,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
TARGET=${1:-eigenpy} TARGET=${1:-eigenpy}
PYVER=${2:-3.9} 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" TARVER="$TARGET-$VERSION"
WHEEL_DIR="${TARGET/-/_}-$VERSION" WHEEL_DIR="${TARGET/-/_}-$VERSION"
PACKAGE="$TARGET" PACKAGE="$TARGET"
[ "$TARGET" = "hpp-fcl" ] && PACKAGE=hppfcl [ "$TARGET" = "hpp-fcl" ] && PACKAGE=hppfcl
PYBIN="$(find /opt/python -name "cp${PYVER/.}*")/bin" 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" INSTALLED_PREFIX="$PWD/_skbuild/linux-x86_64-$PYVER/cmake-install"
SITE_PACKAGES="lib/python$PYVER/site-packages" SITE_PACKAGES="lib/python$PYVER/site-packages"
USER_PACKAGES="$HOME/.local/$SITE_PACKAGES" USER_PACKAGES="$HOME/.local/$SITE_PACKAGES"
...@@ -19,7 +19,7 @@ PACKAGE_DIR="$WHEEL_DIR/$WHEEL_DIR.data/data/$SITE_PACKAGES/$PACKAGE" ...@@ -19,7 +19,7 @@ PACKAGE_DIR="$WHEEL_DIR/$WHEEL_DIR.data/data/$SITE_PACKAGES/$PACKAGE"
# Install dependencies # Install dependencies
"$PYBIN/pip" install --user --find-links=/io/dist/ \ "$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 # Build wheels
"$PYBIN/python" setup.py bdist_wheel -j"$(nproc)" -DBUILD_TESTING=OFF -DINSTALL_DOCUMENTATION=OFF \ "$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}"/* ...@@ -54,7 +54,7 @@ for lib in "$WHEEL_DIR/${LIB_DIR}"/*
do patchelf --set-rpath '$ORIGIN' "$lib" do patchelf --set-rpath '$ORIGIN' "$lib"
done 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=$(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=$(basename "$MAIN_LIB") # libeigenpy-0c5e8890.so
MAIN_LIB_NAME_NO_HASH=$(echo "$MAIN_LIB_NAME" | sed 's/-[[:xdigit:]]\{8\}//') # libeigenpy.so MAIN_LIB_NAME_NO_HASH=$(echo "$MAIN_LIB_NAME" | sed 's/-[[:xdigit:]]\{8\}//') # libeigenpy.so
......
...@@ -13,14 +13,13 @@ from pathlib import Path ...@@ -13,14 +13,13 @@ from pathlib import Path
import auditwheel import auditwheel
USER_PACKAGES = Path(sys.argv[-1])
POLICY = Path(auditwheel.__file__).parent / 'policy/policy.json' POLICY = Path(auditwheel.__file__).parent / 'policy/policy.json'
with POLICY.open() as f: with POLICY.open() as f:
policies = json.load(f) policies = json.load(f)
deps = [] deps = []
for dep in USER_PACKAGES.glob('*.libs'): for dep in Path(sys.argv[-1]).glob('*.libs'):
deps.append(dep.name) deps.append(dep.name)
for lib in dep.glob('*.so*'): for lib in dep.glob('*.so*'):
policies[-1]["lib_whitelist"].append(lib.name) policies[-1]["lib_whitelist"].append(lib.name)
......
...@@ -4,7 +4,7 @@ TARGET=${1:-eigenpy} ...@@ -4,7 +4,7 @@ TARGET=${1:-eigenpy}
PYVER=${2:-3.9} PYVER=${2:-3.9}
URL="$(grep url "/io/config/$TARGET/setup.py" | cut -d'"' -f2)" 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 mkdir -p /io/wheelhouse
[ "$(ls -A /io/wheelhouse)" ] && { echo "./wheelhouse should be empty before running this script."; exit; } [ "$(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" \ ...@@ -15,6 +15,8 @@ curl -sSL "$URL/releases/download/v$VERSION/$TARGET-$VERSION.tar.gz" \
cp "/io/config/$TARGET/setup.py" . cp "/io/config/$TARGET/setup.py" .
cp /scripts/pyproject.toml . cp /scripts/pyproject.toml .
sed -i "s/VERSION/$VERSION/" setup.py
# Fix CMake for scikit-build # Fix CMake for scikit-build
find . -name CMakeLists.txt | xargs sed -i 's/PYTHON_INCLUDE_DIRS/PYTHON_INCLUDE_DIR/' 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 sed -i 's/REQUIRED COMPONENTS Interpreter Development/REQUIRED COMPONENTS Interpreter/' cmake/python.cmake
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment