From a13f24a51ccb6faaa1267c7f4f2715c8217934dd Mon Sep 17 00:00:00 2001 From: Bastian Bechtold Date: Mon, 30 Dec 2024 11:35:49 +0100 Subject: [PATCH 1/8] updates binaries --- _soundfile_data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_soundfile_data b/_soundfile_data index f1655ba..a9a4f7f 160000 --- a/_soundfile_data +++ b/_soundfile_data @@ -1 +1 @@ -Subproject commit f1655ba375f306c4b3b179e1fb603d71b50ce179 +Subproject commit a9a4f7fc136fe1da32ca729e9c3afdd5ce70a6a2 From c40bf09da359c873ec5d9137221b48a8798dd313 Mon Sep 17 00:00:00 2001 From: Bastian Bechtold Date: Mon, 30 Dec 2024 11:53:46 +0100 Subject: [PATCH 2/8] ARM64 binary support added for Linux and Windows --- .gitignore | 2 ++ build_wheels.py | 4 ++-- setup.py | 7 ++++++- soundfile.py | 16 ++++++++++++++-- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0f90457..4311438 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ build/ *.egg-info/ .cache/ .vscode/ +.DS_Store +.venv/ \ No newline at end of file diff --git a/build_wheels.py b/build_wheels.py index a2af99c..2f03786 100644 --- a/build_wheels.py +++ b/build_wheels.py @@ -2,8 +2,8 @@ import shutil architectures = dict(darwin=['x86_64', 'arm64'], - win32=['32bit', '64bit'], - linux=['x86_64'], + win32=['x86', 'x64', 'arm64'], + linux=['x86_64', 'arm64'], noplatform='noarch') def cleanup(): diff --git a/setup.py b/setup.py index f986c50..14fa60f 100644 --- a/setup.py +++ b/setup.py @@ -79,7 +79,12 @@ def get_tag(self): oses = 'win_amd64' elif platform == 'linux': # using the centos:7 runner with glibc2.17: - oses = 'manylinux_2_17_{}'.format(architecture0) + if architecture0 == 'arm64': + pep600_architecture = 'aarch64' + else: + pep600_architecture = architecture0 + + oses = 'manylinux_2_17_{}'.format(pep600_architecture) else: pythons = 'py2.py3' oses = 'any' diff --git a/soundfile.py b/soundfile.py index 31218b6..9758a9f 100644 --- a/soundfile.py +++ b/soundfile.py @@ -157,10 +157,22 @@ _packaged_libname = 'libsndfile_' + _machine() + '.dylib' elif _sys.platform == 'win32': from platform import architecture as _architecture - _packaged_libname = 'libsndfile_' + _architecture()[0] + '.dll' + from platform import machine as _machine + if _machine() == 'ARM64': + _packaged_libname = 'libsndfile_arm64.dll' + elif _architecture()[0] == '64bit': + _packaged_libname = 'libsndfile_x64.dll' + elif _architecture()[0] == '32bit': + _packaged_libname = 'libsndfile_x86.dll' + else: + raise OSError('no packaged library for Windows {} {}' + .format(_architecture(), _machine())) elif _sys.platform == 'linux': from platform import machine as _machine - _packaged_libname = 'libsndfile_' + _machine() + '.so' + if _machine() in ["aarch64", "aarch64_be", "armv8b", "armv8l"]: + _packaged_libname = 'libsndfile_arm64.so' + else: + _packaged_libname = 'libsndfile_' + _machine() + '.so' else: raise OSError('no packaged library for this platform') From 1f77309a38d7a6f4a36e9e20588bc4b3a1292917 Mon Sep 17 00:00:00 2001 From: Bastian Bechtold Date: Mon, 30 Dec 2024 12:10:36 +0100 Subject: [PATCH 3/8] just a test --- soundfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/soundfile.py b/soundfile.py index 9758a9f..34e77e6 100644 --- a/soundfile.py +++ b/soundfile.py @@ -182,6 +182,8 @@ _snd = _ffi.dlopen(_full_path) # OSError if file doesn't exist or can't be loaded except (OSError, ImportError, TypeError): + import pathlib + print('DEBUG: {} exists: {}'.format(_full_path, pathlib.Path(_full_path).exists())) try: # system-wide libsndfile: _libname = _find_library('sndfile') if _libname is None: From b5a3dd6063b2cfc9d5f4588af9be701e44f416b0 Mon Sep 17 00:00:00 2001 From: Bastian Bechtold Date: Mon, 30 Dec 2024 12:25:37 +0100 Subject: [PATCH 4/8] updates test OSes --- .github/workflows/python-package.yml | 12 ++++++++---- soundfile.py | 2 -- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 31cb6e9..6c3e694 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2019, macos-11] + os: [ubuntu-latest, windows-latest, macos-latest] python-version: - "3.6" - "3.7" @@ -16,15 +16,19 @@ jobs: - "3.9" - "3.10" - "3.11" + - "3.12" + - "3.13" - "pypy-3.7" - "pypy-3.8" + - "pypy-3.9" + - "pypy-3.10" architecture: ["x86", "x64"] exclude: - - os: macos-11 # No Numpy binary wheel + - os: macos-latest # No Numpy binary wheel python-version: "pypy-3.7" - - os: macos-11 + - os: macos-latest architecture: "x86" - - os: ubuntu-20.04 + - os: ubuntu-latest architecture: "x86" steps: diff --git a/soundfile.py b/soundfile.py index 34e77e6..9758a9f 100644 --- a/soundfile.py +++ b/soundfile.py @@ -182,8 +182,6 @@ _snd = _ffi.dlopen(_full_path) # OSError if file doesn't exist or can't be loaded except (OSError, ImportError, TypeError): - import pathlib - print('DEBUG: {} exists: {}'.format(_full_path, pathlib.Path(_full_path).exists())) try: # system-wide libsndfile: _libname = _find_library('sndfile') if _libname is None: From 09181f551ade4a226c5626bc6893f08c26f93a03 Mon Sep 17 00:00:00 2001 From: Bastian Bechtold Date: Mon, 30 Dec 2024 15:48:19 +0100 Subject: [PATCH 5/8] updates binaries with fixed windows DLLs --- _soundfile_data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_soundfile_data b/_soundfile_data index a9a4f7f..dd1c4a5 160000 --- a/_soundfile_data +++ b/_soundfile_data @@ -1 +1 @@ -Subproject commit a9a4f7fc136fe1da32ca729e9c3afdd5ce70a6a2 +Subproject commit dd1c4a5b2f00185b2e387431296560dd691e0a08 From a0945faa8ccdf43220527b50329f100f30dfee50 Mon Sep 17 00:00:00 2001 From: Bastian Bechtold Date: Mon, 30 Dec 2024 15:48:47 +0100 Subject: [PATCH 6/8] updates test dependencies --- .github/workflows/python-package.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 6c3e694..054cc5b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -10,9 +10,6 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] python-version: - - "3.6" - - "3.7" - - "3.8" - "3.9" - "3.10" - "3.11" @@ -26,6 +23,8 @@ jobs: exclude: - os: macos-latest # No Numpy binary wheel python-version: "pypy-3.7" + - os: macos-latest + python-version: "3.10" - os: macos-latest architecture: "x86" - os: ubuntu-latest From 56105cd4a9b4d920ed86894933f7324fa17af22d Mon Sep 17 00:00:00 2001 From: Bastian Bechtold Date: Mon, 30 Dec 2024 16:12:20 +0100 Subject: [PATCH 7/8] skip unsupported pypy versions on Windows --- .github/workflows/python-package.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 054cc5b..ed1c1e0 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -23,12 +23,18 @@ jobs: exclude: - os: macos-latest # No Numpy binary wheel python-version: "pypy-3.7" + - os: macos-latest + python-version: "3.9" - os: macos-latest python-version: "3.10" - os: macos-latest architecture: "x86" - os: ubuntu-latest architecture: "x86" + - os: windows-latest + python-version: "pypy-3.9" + - os: windows-latest + python-version: "pypy-3.10" steps: - name: Install APT dependencies From 26a7d667bc72b3b652fdd539329a8d5596816e77 Mon Sep 17 00:00:00 2001 From: Bastian Bechtold Date: Mon, 30 Dec 2024 16:30:10 +0100 Subject: [PATCH 8/8] use linux binaries from the wheel for tests --- .github/workflows/python-package.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ed1c1e0..ad26484 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -37,11 +37,6 @@ jobs: python-version: "pypy-3.10" steps: - - name: Install APT dependencies - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install libsndfile1 - uses: actions/checkout@v2 with: submodules: true