Compare commits

..

27 commits
v0.1.0 ... main

Author SHA1 Message Date
2fa5defe08 Update for 0.1.1 2024-09-06 13:44:54 -04:00
6fa95fd45d Bring the prod release action script in line with the working test release. 2024-09-06 13:36:13 -04:00
33a330641f Cleanup. Make the libsndfile version less specific. 2024-09-06 13:35:19 -04:00
fa6250d649 Skip troublesome tests on s390x and add some comments for clarity. 2024-09-05 20:33:27 -04:00
f89f5a6295 Helps if I install the python-soundfile module first. 2024-09-05 07:08:25 -04:00
9048ddf99d Hack to force detect libsndfile. 2024-09-05 00:22:30 -04:00
182ac825de Trying to debug musllinux image not detecting the libsndfile library. 2024-09-04 20:57:19 -04:00
c5c32ab5fd Fix musllinux detection and move most CIBW options to pyproject.toml. 2024-09-04 13:27:14 -04:00
53ba10ee35 Image is RedHat/CentOS, not Ubuntu. 2024-09-04 10:57:43 -04:00
ccb4a221a8 Install libsndfile for linux/macos. 2024-09-04 10:48:58 -04:00
03ea02690b Attempt to add testing to the wheel build process. 2024-09-04 10:35:29 -04:00
684a20f530 Temporarily disable ARM64 for Windows. 2024-09-03 23:06:26 -04:00
7ec8e0300e Update required Python versions and add more architectures. 2024-09-03 22:06:34 -04:00
985ef13cf9 Update PyPI to use Trusted Publishing. 2024-09-03 21:42:55 -04:00
ea42a66eb9 Another upload fix maybe. 2024-09-03 21:17:17 -04:00
4125491113 Potential fix for uploading artifacts. 2024-09-03 21:11:54 -04:00
33f4475300 Whoops. 2024-09-03 21:05:11 -04:00
6ac2f348af I have no mouth and I must scream. 2024-09-03 21:03:15 -04:00
533523c18c This is harder than it needs to be. 2024-09-03 20:49:34 -04:00
75fb06fe23 I'll get this right yet. 2024-09-03 20:46:30 -04:00
b8ce0c6635 Potential fix to upload/download artifacts. 2024-09-03 20:34:33 -04:00
388e73d1fb Remove 32-bit. Rework cross-compilation. 2024-09-03 20:19:52 -04:00
d15baf015f Update repo versions. 2024-09-03 15:19:03 -04:00
9bf45d3a21 Single quotes. 2024-09-03 14:57:52 -04:00
e696d8568a Versions should be str, not float. 2024-09-03 14:56:29 -04:00
856f522996 Removed MSVC check. 2024-09-03 14:49:34 -04:00
42c2c0cd82 Update Python versions and fix shield badge. 2024-09-03 10:50:23 -04:00
8 changed files with 134 additions and 125 deletions

View file

@ -16,13 +16,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install build twine
@ -30,8 +30,9 @@ jobs:
run: |
python -m build --sdist
- name: Put SDist in artifact container
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
- name: Check SDist metadata
run: |
@ -42,61 +43,55 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
bitness: [32, 64]
python: [3.6, 3.7, 3.8, 3.9]
include:
- os: windows-latest
bitness: 64
platform_id: win_amd64
- os: windows-latest
bitness: 32
platform_id: win32
- os: ubuntu-latest
bitness: 64
platform_id: manylinux_x86_64
- os: ubuntu-latest
bitness: 32
platform_id: manylinux_i686
- os: macos-latest
bitness: 64
platform_id: macosx_x86_64
exclude:
- os: macos-latest
bitness: 32
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up QEMU on Linux images
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Get Python Version Name
uses: mad9000/actions-find-and-replace-string@2
uses: mad9000/actions-find-and-replace-string@5
id: pythonversion
with:
source: ${{ matrix.python }}
find: '.'
replace: ''
- name: Build wheels
uses: joerick/cibuildwheel@v1.10.0
- name: "Install Python 3.8 universal2 on macOS arm64"
if: runner.os == 'macOS' && runner.arch == 'arm64'
uses: actions/setup-python@v5
env:
CIBW_BUILD: cp${{ steps.pythonversion.outputs.value }}-${{ matrix.platform_id }}
PIP_DISABLE_PIP_VERSION_CHECK: 1
with:
python-version: 3.8
- name: Build wheels
uses: joerick/cibuildwheel@v2.20.0
env:
CIBW_BUILD: "cp${{ steps.pythonversion.outputs.value }}-*"
CIBW_ENVIRONMENT: "SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}"
- name: Upload wheels to artifact container
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: wheelhouse/*.whl
upload_all:
needs: [build_wheels, make_sdist]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Get SDist and wheels from artifact container
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: artifact
pattern: cibw-*
path: dist
- name: Publish wheels to Test PyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
merge-multiple: true
- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

View file

@ -16,13 +16,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install build twine
@ -30,8 +30,9 @@ jobs:
run: |
python -m build --sdist
- name: Put SDist in artifact container
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
- name: Check SDist metadata
run: |
@ -42,62 +43,57 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
bitness: [32, 64]
python: [3.6, 3.7, 3.8, 3.9]
include:
- os: windows-latest
bitness: 64
platform_id: win_amd64
- os: windows-latest
bitness: 32
platform_id: win32
- os: ubuntu-latest
bitness: 64
platform_id: manylinux_x86_64
- os: ubuntu-latest
bitness: 32
platform_id: manylinux_i686
- os: macos-latest
bitness: 64
platform_id: macosx_x86_64
exclude:
- os: macos-latest
bitness: 32
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up QEMU on Linux images
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Get Python Version Name
uses: mad9000/actions-find-and-replace-string@2
uses: mad9000/actions-find-and-replace-string@5
id: pythonversion
with:
source: ${{ matrix.python }}
find: '.'
replace: ''
- name: Build wheels
uses: joerick/cibuildwheel@v1.10.0
- name: "Install Python 3.8 universal2 on macOS arm64"
if: runner.os == 'macOS' && runner.arch == 'arm64'
uses: actions/setup-python@v5
env:
CIBW_BUILD: cp${{ steps.pythonversion.outputs.value }}-${{ matrix.platform_id }}
PIP_DISABLE_PIP_VERSION_CHECK: 1
with:
python-version: 3.8
- name: Build wheels
uses: joerick/cibuildwheel@v2.20.0
env:
CIBW_BUILD: "cp${{ steps.pythonversion.outputs.value }}-*"
CIBW_ENVIRONMENT: "SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}"
- name: Upload wheels to artifact container
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
upload_all:
needs: [build_wheels, make_sdist]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Get SDist and wheels from artifact container
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: artifact
pattern: cibw-*
path: dist
merge-multiple: true
- name: Publish wheels to Test PyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.TEST_PYPI_USERNAME }}
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

View file

@ -16,16 +16,16 @@ jobs:
build:
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install libsndfile if necessary (Linux)
@ -46,8 +46,8 @@ jobs:
- name: Upload coverage to Codecov.io
run: |
bash <(curl -s https://codecov.io/bash)
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
- uses: actions/upload-artifact@v2
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' }}
- uses: actions/upload-artifact@v4
with:
path: coverage.xml
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' }}

View file

@ -2,6 +2,15 @@
## [Unreleased] - ??-??-????
## [0.1.1] - 2024-09-06
### Changed
* Base Python version is now 3.8.
* Supports up to Python 3.12
* Now builds for most other supported architectures. (Windows ARM64 disabled for now)
### Fixed
* Removed MSVC check due to setuptools deprecating more of distutils functions. (#1)
## [0.1.0] - 2021-03-25
### Added
* First release!

View file

@ -1,4 +1,4 @@
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jodhus/pyebur128/Run%20tests)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/jodhus/pyebur128/run-tests.yml?branch=main)
[![codecov](https://codecov.io/gh/jodhus/pyebur128/branch/master/graph/badge.svg?token=TLA2NXMEF4)](https://codecov.io/gh/jodhus/pyebur128)
![GitHub](https://img.shields.io/github/license/jodhus/pyebur128)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyebur128)
@ -11,7 +11,7 @@ A Cython implementation of the [libebur128](https://github.com/jiixyj/libebur128
## Requirements
* Operating Systems: Linux, macOS, or Windows
* Python: 3.6+
* Python: 3.8+
* Dependencies: None!
## Installation

View file

@ -1,12 +1,40 @@
[build-system]
requires = [
'wheel',
'setuptools',
'Cython',
'setuptools_scm[toml]',
]
requires = ['wheel', 'setuptools', 'Cython', 'setuptools_scm[toml]']
build-backend = 'setuptools.build_meta'
[tool.cibuildwheel]
test-command = 'pytest {package}/tests'
test-extras = ['tests']
# There seems to be a problem compiling NumPy for testing due to a missing
# constant definition for s390x builds. Skipping for now.
test-skip = "*-musllinux_s390x"
[tool.cibuildwheel.linux]
archs = ['auto', 'aarch64', 'ppc64le', 's390x']
before-test = "yum -y install libsndfile"
[tool.cibuildwheel.macos]
before-test = "brew install libsndfile"
# Will re-enable Windows ARM64 once libebur128 pull request #131 is merged.
# https://github.com/jiixyj/libebur128/pull/131
#[tool.cibuildwheel.windows]
#archs = ['auto', 'ARM64']
[[tool.cibuildwheel.overrides]]
# There is a known issue with buildroot/musl images not detecting libraries
# correctly. Python's ctypes library is affected by this, which is needed by
# python-soundfile to use libsndfile. This hack is to get around this issue to
# be able to test on musllinux successfully.
# See https://github.com/bastibe/python-soundfile/issues/258
select = '*-musllinux*'
before-test = [
'apk add libsndfile',
'pip install soundfile',
'PYVER=`python -c "import sys; print(\".\".join(map(str, sys.version_info[:2])))"`',
'sed -i "192b1; b ;:1;s/_explicit_libname/\"\/usr\/lib\/libsndfile.so.1\"/g" $VIRTUAL_ENV/lib/python$PYVER/site-packages/soundfile.py',
]
[tool.pytest.ini_options]
minversion = '6.0'
addopts = '--cov-report=xml --cov-report=term:skip-covered --cov=pyebur128'

View file

@ -34,10 +34,11 @@ classifiers =
Operating System :: Microsoft :: Windows
Programming Language :: Cython
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Multimedia :: Sound/Audio
Topic :: Multimedia :: Sound/Audio :: Analysis
@ -45,7 +46,7 @@ classifiers =
[options]
zip_safe = True
include_package_data = True
python_requires = >= 3.6
python_requires = >= 3.8
install_requires =
packages = find:
package_dir =

View file

@ -1,35 +1,7 @@
#!/usr/bin/python3
import platform
from setuptools import setup, Extension
from setuptools import setup, find_packages, Extension
from distutils.ccompiler import new_compiler
from distutils.msvccompiler import MSVCCompiler
def is_msvc():
'''Checks to see if the detected C compiler is MSVC.'''
try:
# This depends on _winreg, which is not available on not-Windows.
from distutils.msvc9compiler import MSVCCompiler as MSVC9Compiler
except ImportError:
MSVC9Compiler = None
try:
from distutils._msvccompiler import MSVCCompiler as MSVC14Compiler
except ImportError:
MSVC14Compiler = None
msvc_classes = tuple(filter(None, (MSVCCompiler,
MSVC9Compiler,
MSVC14Compiler)))
cc = new_compiler()
return isinstance(cc, msvc_classes)
macros = []
# MSVC won't use <math.h> unless this is defined.
if platform.system() == 'Windows' and is_msvc():
macros.append(('_USE_MATH_DEFINES', None))
extensions = [
Extension(
@ -43,7 +15,15 @@ extensions = [
'src/lib/ebur128',
'src/lib/ebur128/queue',
],
define_macros=macros,
# Not happy about it, but I'll just use this macro on all compilers for
# now. Setuptools doesn't have a reliable way to detect MSVC when they
# started deprecating the older distutils functionality of MSVCCompiler
# and new_compiler(). Besides, looking at the old distutils code, it
# just assumed that MSVC was the compiler if it detected Windows. If you
# wanted GCC/MinGW/LLVM on Windows, you had to manually pass it as an
# argument to new_compiler().
# See https://github.com/pypa/setuptools/issues/2806
define_macros=[('_USE_MATH_DEFINES', None)],
),
]