Compare commits

..

No commits in common. "main" and "v0.1.0" have entirely different histories.
main ... v0.1.0

8 changed files with 123 additions and 132 deletions

View file

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

View file

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

View file

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

View file

@ -2,15 +2,6 @@
## [Unreleased] - ??-??-???? ## [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 ## [0.1.0] - 2021-03-25
### Added ### Added
* First release! * First release!

View file

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

View file

@ -1,39 +1,11 @@
[build-system] [build-system]
requires = ['wheel', 'setuptools', 'Cython', 'setuptools_scm[toml]'] requires = [
build-backend = 'setuptools.build_meta' 'wheel',
'setuptools',
[tool.cibuildwheel] 'Cython',
test-command = 'pytest {package}/tests' 'setuptools_scm[toml]',
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',
] ]
build-backend = 'setuptools.build_meta'
[tool.pytest.ini_options] [tool.pytest.ini_options]
minversion = '6.0' minversion = '6.0'

View file

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

View file

@ -1,7 +1,35 @@
#!/usr/bin/python3 #!/usr/bin/python3
from setuptools import setup, Extension import platform
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 = [ extensions = [
Extension( Extension(
@ -15,15 +43,7 @@ extensions = [
'src/lib/ebur128', 'src/lib/ebur128',
'src/lib/ebur128/queue', 'src/lib/ebur128/queue',
], ],
# Not happy about it, but I'll just use this macro on all compilers for define_macros=macros,
# 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)],
), ),
] ]