Skip to content

Commit

Permalink
Prepare 0.2.1 (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 authored Sep 25, 2024
1 parent f2d5984 commit a9dcc66
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 32 deletions.
35 changes: 24 additions & 11 deletions .github/scripts/install-wavpack-linux.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
#!/bin/bash

# Check if WAVPACK_VERSION argument is provided
if [ -z "$1" ]; then
echo "Error: WAVPACK_VERSION argument is required."
exit 1
else
WAVPACK_VERSION=$1
fi

# Check if TARGET_FOLDER argument is provided
if [ -n "$1" ]; then
TARGET_FOLDER=$1
# Create the target folder if it doesn't exist
if [ -z "$2" ]; then
TARGET_FOLDER=$(pwd)
else
TARGET_FOLDER=$2
mkdir -p "$TARGET_FOLDER"
# Change directory to the target folder
cd "$TARGET_FOLDER"
fi

CWD=$(pwd)
cd "$TARGET_FOLDER"

echo "Installing WavPack $WAVPACK_VERSION into $TARGET_FOLDER - CWD: $CWD"

sudo apt update
sudo apt install wget
sudo apt install -y gettext

WAVPACK_LATEST_VERSION="$(cat .github/wavpack_latest_version.txt)"

wget "https://www.wavpack.com/wavpack-$WAVPACK_LATEST_VERSION.tar.bz2"
tar -xf wavpack-$WAVPACK_LATEST_VERSION.tar.bz2
cd wavpack-$WAVPACK_LATEST_VERSION
wget "https://www.wavpack.com/wavpack-${WAVPACK_VERSION}.tar.bz2"
tar -xf wavpack-$WAVPACK_VERSION.tar.bz2
cd wavpack-$WAVPACK_VERSION
./configure
sudo make install
cd ..
cd ..

echo "WavPack $WAVPACK_VERSION installed into $TARGET_FOLDER Changing directory to: $CWD"
cd "$CWD"
36 changes: 21 additions & 15 deletions .github/workflows/build-wavpack-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,41 @@ jobs:
echo "GLIBC Version: $GLIBC_VERSION"
echo "GLIBC_VERSION=$GLIBC_VERSION" >> $GITHUB_ENV
- name: Build wavpack libraries
id: build-wavpack
run: |
WAVPACK_LATEST_VERSION="$(cat .github/wavpack_latest_version.txt)"
TARGET_FOLDER="./wavpack_src"
WAVPACK_LATEST_VERSION="$(cat ./.github/wavpack_latest_version.txt)"
echo "wavpack latest version: $WAVPACK_LATEST_VERSION"
TARGET_FOLDER="$(pwd)/wavpack_src"
chmod +x ./.github/scripts/install-wavpack-linux.sh
./.github/scripts/install-wavpack-linux.sh $TARGET_FOLDER
./.github/scripts/install-wavpack-linux.sh $WAVPACK_LATEST_VERSION $TARGET_FOLDER
# copy the built library to the libraries/folder
LIB_FOLDER_NAME="$WAVPACK_LATEST_VERSION/linux-x86_64-glibc$GLIBC_VERSION"
echo "LIB_FOLDER_NAME=$LIB_FOLDER_NAME" >> $GITHUB_ENV
echo "LIB_FOLDER_NAME=$LIB_FOLDER_NAME" >> "$GITHUB_OUTPUT"
WAVPACK_NUMCODECS_LIB_PATH="src/wavpack_numcodecs/libraries/$LIB_FOLDER_NAME"
echo "WAVPACK_NUMCODECS_LIB_PATH=$WAVPACK_NUMCODECS_LIB_PATH" >> $GITHUB_ENV
# find compiled library
LIBWAVPACK_PATH="$(find $TARGET_FOLDER/src/.libs -type f | grep libwavpack.so)"
mv $LIBWAVPACK_PATH $WAVPACK_NUMCODECS_LIB_PATH/libwavpack.so
rm -r $TARGET_FOLDER
LIBWAVPACK_PATH="$(find $TARGET_FOLDER/wavpack-$WAVPACK_LATEST_VERSION/src/.libs -type f | grep libwavpack.so)"
mkdir -p $WAVPACK_NUMCODECS_LIB_PATH
cp $LIBWAVPACK_PATH $WAVPACK_NUMCODECS_LIB_PATH/libwavpack.so
sudo rm -f -r $TARGET_FOLDER
- name: Install wavpack numcodecs
run: |
pip install .[test]
- name: Test imports
run: |
pytest -s tests/test_imports.py
- name: Test with pytest
- name: Create commits
run: |
pytest -v
git config user.name 'Alessio Buccino'
git config user.email '[email protected]'
git config core.fileMode false
git add -f $WAVPACK_NUMCODECS_LIB_PATH/libwavpack.so
git commit -m "Updated ${{ steps.build-wavpack.outputs.LIB_FOLDER_NAME }} wavpack binaries"
- name: Make PR with updated binaries
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v7
with:
commit-message: "Update $LIB_FOLDER_NAME wavpack binaries"
title: "Update wavpack binaries"
body: "This PR updates the wavpack binaries."
branch: "update-wavpack-binaries"
title: "Update wavpack binaries for ${{ steps.build-wavpack.outputs.LIB_FOLDER_NAME }}"
body: "This PR updates the wavpack binaries for ${{ steps.build-wavpack.outputs.LIB_FOLDER_NAME }}"
branch-suffix: short-commit-hash
base: "main"
add-paths: "src/wavpack_numcodecs/libraries"
4 changes: 2 additions & 2 deletions .github/workflows/python-package-cython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
- name: Install WavPack (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
WAVPACK_LATEST_VERSION="$(cat ./.github/wavpack_latest_version.txt)"
chmod +x ./.github/scripts/install-wavpack-linux.sh
./.github/scripts/install-wavpack-linux.sh
./.github/scripts/install-wavpack-linux.sh $WAVPACK_LATEST_VERSION
# check libraries
ls /usr/local/lib/ | grep wavpack
Expand All @@ -43,7 +44,6 @@ jobs:
which python
- name: Install dependencies
run: |
pip install Cython
pip install .[test]
- name: Test imports and version
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/python-package-multi-threading.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
- name: Install WavPack (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
WAVPACK_LATEST_VERSION="$(cat ./.github/wavpack_latest_version.txt)"
chmod +x ./.github/scripts/install-wavpack-linux.sh
./.github/scripts/install-wavpack-linux.sh
./.github/scripts/install-wavpack-linux.sh $WAVPACK_LATEST_VERSION
# check libraries
ls /usr/local/lib/ | grep wavpack
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/python-package-no-cython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
- name: Install WavPack (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
WAVPACK_LATEST_VERSION="$(cat ./.github/wavpack_latest_version.txt)"
chmod +x ./.github/scripts/install-wavpack-linux.sh
./.github/scripts/install-wavpack-linux.sh
./.github/scripts/install-wavpack-linux.sh $WAVPACK_LATEST_VERSION
# check libraries
ls /usr/local/lib/ | grep wavpack
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "wavpack-numcodecs"
version = "0.2.0"
version = "0.2.1"
description = "Numcodecs implementation of WavPack audio codec."
authors = [
{name = "Alessio Buccino", email = "[email protected]"},
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_build_extensions():
f"Could not find a matching glibc version for the shipped libraries. "
f"Available builds: {available_glibc_versions}"
)
distr_folder = f"linux-x86_64_glibc{glibc_version}"
distr_folder = f"linux-x86_64-glibc{glibc_version}"

extra_link_args = [f"-L{wavpack_libraries_folder}/{distr_folder}"]
runtime_library_dirs = [
Expand Down
Binary file not shown.

0 comments on commit a9dcc66

Please sign in to comment.