Skip to content

Commit

Permalink
Merge pull request #14 from AllenNeuralDynamics/python-versions
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
alejoe91 authored Sep 15, 2024
2 parents 0a0587f + e73cc59 commit e12e9fa
Show file tree
Hide file tree
Showing 33 changed files with 568 additions and 518 deletions.
10 changes: 10 additions & 0 deletions .github/scripts/install-wavpack-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sudo apt update
sudo apt install wget
sudo apt install -y gettext

wget https://www.wavpack.com/wavpack-5.7.0.tar.bz2
tar -xf wavpack-5.7.0.tar.bz2
cd wavpack-5.7.0
./configure
sudo make install
cd ..
8 changes: 4 additions & 4 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.11
- name: Install dependencies for testing
run: |
pip install pytest
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/python-package-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ on:

jobs:
build-and-test:
name: Test on (${{ matrix.os }})
name: Test on ${{ matrix.os }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: s-weigand/setup-conda@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: ${{ matrix.python-version }}
- name: Python version
run: |
which python
Expand All @@ -28,6 +29,9 @@ jobs:
pip install .
pip install zarr
pip install pytest
- name: Installed wavpack version
run: |
python -c "import wavpack_numcodecs; print(wavpack_numcodecs.wavpack_version)"
- name: Test imports and version
run: |
pytest -s tests/test_imports.py
Expand Down
36 changes: 14 additions & 22 deletions .github/workflows/python-package-cython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,36 @@ on:

jobs:
build-and-test:
name: Test on (${{ matrix.os }})
name: Test on ${{ matrix.os }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: s-weigand/setup-conda@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: ${{ matrix.python-version }}
- name: Install WavPack (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install wget
sudo apt install -y gettext
wget https://www.wavpack.com/wavpack-5.6.0.tar.bz2
tar -xf wavpack-5.6.0.tar.bz2
cd wavpack-5.6.0
./configure
sudo make install
cd ..
chmod +x ./.github/scripts/install-wavpack-linux.sh
./.github/scripts/install-wavpack-linux.sh
# check libraries
ls /usr/local/lib/ | grep wavpack
- name: Set up Homebrew (macos)
if: matrix.os == 'macos-latest'
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install WavPack (macos)
if: matrix.os == 'macos-latest'
run: |
conda install wget
wget https://www.wavpack.com/wavpack-5.6.0.tar.bz2
tar -xf wavpack-5.6.0.tar.bz2
cd wavpack-5.6.0
./configure
sudo make install
cd ..
brew install wavpack
# check version
brew info wavpack
- name: Python version
run: |
which python
Expand Down
34 changes: 18 additions & 16 deletions .github/workflows/python-package-multi-threading.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,36 @@ on:

jobs:
build-and-test:
name: Test on (${{ matrix.os }})
name: Test on ${{ matrix.os }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: s-weigand/setup-conda@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: ${{ matrix.python-version }}
- name: Install WavPack (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install git
sudo apt install -y gettext
git clone https://github.com/dbry/WavPack
cd WavPack
git checkout 05a49108ee9af791d4cdca5faa84349b518f4827
./autogen.sh
make
sudo make install
cd ..
chmod +x ./.github/scripts/install-wavpack-linux.sh
./.github/scripts/install-wavpack-linux.sh
# check libraries
ls /usr/local/lib/ | grep wavpack
- name: Set up Homebrew (macos)
if: matrix.os == 'macos-latest'
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install WavPack (macos)
if: matrix.os == 'macos-latest'
run: |
brew install wavpack
# check version
brew info wavpack
- name: Python version
run: |
which python
Expand Down
36 changes: 14 additions & 22 deletions .github/workflows/python-package-no-cython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,36 @@ on:

jobs:
build-and-test:
name: Test on (${{ matrix.os }})
name: Test on ${{ matrix.os }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: s-weigand/setup-conda@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: ${{ matrix.python-version }}
- name: Install WavPack (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install wget
sudo apt install -y gettext
wget https://www.wavpack.com/wavpack-5.6.0.tar.bz2
tar -xf wavpack-5.6.0.tar.bz2
cd wavpack-5.6.0
./configure
sudo make install
cd ..
chmod +x ./.github/scripts/install-wavpack-linux.sh
./.github/scripts/install-wavpack-linux.sh
# check libraries
ls /usr/local/lib/ | grep wavpack
- name: Set up Homebrew (macos)
if: matrix.os == 'macos-latest'
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install WavPack (macos)
if: matrix.os == 'macos-latest'
run: |
conda install wget
wget https://www.wavpack.com/wavpack-5.6.0.tar.bz2
tar -xf wavpack-5.6.0.tar.bz2
cd wavpack-5.6.0
./configure
sudo make install
cd ..
brew install wavpack
# check version
brew info wavpack
- name: Python version
run: |
which python
Expand Down
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
This implementation enables one to use WavPack as a compressor in
[Zarr](https://zarr.readthedocs.io/en/stable/index.html).


### Requirements

To install `wavpack-numcodecs` on MacOS, you need to install `wavpack` with `brew`:

```bash
brew install wavpack
```

For Linux and Windows, the package comes with pre-built binaries of the most
[recent version Wavpack version](https://github.com/dbry/WavPack/releases/tag/5.7.0).

On Linux, if an existing `wavpack` installation is found, the package will use it. Otherwise, it will use the pre-built binaries available in the `wavpack_numcodecs/libraries` folder.

## Installation

Install via `pip`:
Expand Down Expand Up @@ -45,4 +59,18 @@ Available `**kwargs` can be browsed with: `WavPack?`

**NOTE:**
In order to reload in zarr an array saved with the `WavPack`, you just need to have the `wavpack_numcodecs` package
installed.
installed.

# Developmers guide

## How to upgrade WavPack installation

To upgrade the WavPack installation, you need to:

1. Download the latest version of WavPack from the [official website](https://www.wavpack.com/downloads.html).
2. Extract the content of the downloaded file.
3. Create a new folder in the `src/wavpack_numcodecs/libraries` folder with the name of the version of the WavPack you are installing.
4. Add the Windows .dll and .lib files to the `windows-x86_32` and `windows-x86_64` folders, respectievely.
5. Build the Linux shared library and copy the `.so` file to the `linux-x86_64` folder.
6. Set the `LATET_WAVPACK_VERSION` variable in the `setup.py` to match the version of the WavPack you are installing.
7. Update the version of the CI workflows in the `.github/workflows/` folder.
46 changes: 46 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[project]
name = "wavpack-numcodecs"
version = "0.2.0"
description = "Numcodecs implementation of WavPack audio codec."
authors = [
{name = "Alessio Buccino", email = "alessiop.buccino@gmail.com"},
{name = "David Bryant", email = "david@wavpack.com"},
]
readme = "README.md"
license = {text = "MIT"}
keywords = ["example", "project"]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = [
"numpy",
"numcodecs",
"packaging"
]

[project.urls]
"Homepage" = "https://github.com/AllenNeuralDynamics/wavpack-numcodecs"



[build-system]
requires = ["setuptools>=62.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
include-package-data = true
package-data = {"wavpack_numcodecs" = ["**/*.pyx", "**/*.pxd", "**/*.c", "**/*.h", "**/*.so", "**/*.so.*", "**/*.dll"]}

[tool.setuptools.exclude-package-data]
wavpack_numcodecs = ["**/tests/test_*"]

[tool.setuptools.packages.find]
where = ["src"]
include = ["wavpack_numcodecs*"]
namespaces = false
exclude = ["wavpack_numcodecs.*.tests"]

[tool.black]
line-length = 120
Loading

0 comments on commit e12e9fa

Please sign in to comment.