Compare commits
No commits in common. "main" and "v0.1.0" have entirely different histories.
8 changed files with 123 additions and 132 deletions
71
.github/workflows/build-pypi.yml
vendored
71
.github/workflows/build-pypi.yml
vendored
|
@ -16,13 +16,13 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.12'
|
||||
python-version: '3.8'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install build twine
|
||||
|
@ -30,9 +30,8 @@ jobs:
|
|||
run: |
|
||||
python -m build --sdist
|
||||
- name: Put SDist in artifact container
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: cibw-sdist
|
||||
path: dist/*.tar.gz
|
||||
- name: Check SDist metadata
|
||||
run: |
|
||||
|
@ -43,55 +42,61 @@ jobs:
|
|||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
|
||||
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
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
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
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@5
|
||||
uses: mad9000/actions-find-and-replace-string@2
|
||||
id: pythonversion
|
||||
with:
|
||||
source: ${{ matrix.python }}
|
||||
find: '.'
|
||||
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
|
||||
uses: joerick/cibuildwheel@v2.20.0
|
||||
uses: joerick/cibuildwheel@v1.10.0
|
||||
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 }}"
|
||||
- name: Upload wheels to artifact container
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v2
|
||||
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@v4
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
pattern: cibw-*
|
||||
name: artifact
|
||||
path: dist
|
||||
merge-multiple: true
|
||||
- name: Publish wheels to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
- name: Publish wheels to Test PyPI
|
||||
uses: pypa/gh-action-pypi-publish@v1.4.2
|
||||
with:
|
||||
user: ${{ secrets.PYPI_USERNAME }}
|
||||
password: ${{ secrets.PYPI_PASSWORD }}
|
||||
|
|
72
.github/workflows/build-test-pypi.yml
vendored
72
.github/workflows/build-test-pypi.yml
vendored
|
@ -16,13 +16,13 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.12'
|
||||
python-version: '3.8'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install build twine
|
||||
|
@ -30,9 +30,8 @@ jobs:
|
|||
run: |
|
||||
python -m build --sdist
|
||||
- name: Put SDist in artifact container
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: cibw-sdist
|
||||
path: dist/*.tar.gz
|
||||
- name: Check SDist metadata
|
||||
run: |
|
||||
|
@ -43,57 +42,62 @@ jobs:
|
|||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
|
||||
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
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
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
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@5
|
||||
uses: mad9000/actions-find-and-replace-string@2
|
||||
id: pythonversion
|
||||
with:
|
||||
source: ${{ matrix.python }}
|
||||
find: '.'
|
||||
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
|
||||
uses: joerick/cibuildwheel@v2.20.0
|
||||
uses: joerick/cibuildwheel@v1.10.0
|
||||
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 }}"
|
||||
- name: Upload wheels to artifact container
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
|
||||
path: ./wheelhouse/*.whl
|
||||
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@v4
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
pattern: cibw-*
|
||||
name: artifact
|
||||
path: dist
|
||||
merge-multiple: true
|
||||
- name: Publish wheels to Test PyPI
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
uses: pypa/gh-action-pypi-publish@v1.4.2
|
||||
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/
|
||||
|
|
12
.github/workflows/run-tests.yml
vendored
12
.github/workflows/run-tests.yml
vendored
|
@ -16,16 +16,16 @@ jobs:
|
|||
build:
|
||||
strategy:
|
||||
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]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v2
|
||||
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.12' }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: coverage.xml
|
||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' }}
|
||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
|
|
@ -2,15 +2,6 @@
|
|||
|
||||
## [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!
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||

|
||||

|
||||
[](https://codecov.io/gh/jodhus/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.8+
|
||||
* Python: 3.6+
|
||||
* Dependencies: None!
|
||||
|
||||
## Installation
|
||||
|
|
|
@ -1,39 +1,11 @@
|
|||
[build-system]
|
||||
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',
|
||||
requires = [
|
||||
'wheel',
|
||||
'setuptools',
|
||||
'Cython',
|
||||
'setuptools_scm[toml]',
|
||||
]
|
||||
build-backend = 'setuptools.build_meta'
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
minversion = '6.0'
|
||||
|
|
|
@ -34,11 +34,10 @@ 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
|
||||
|
@ -46,7 +45,7 @@ classifiers =
|
|||
[options]
|
||||
zip_safe = True
|
||||
include_package_data = True
|
||||
python_requires = >= 3.8
|
||||
python_requires = >= 3.6
|
||||
install_requires =
|
||||
packages = find:
|
||||
package_dir =
|
||||
|
|
40
setup.py
40
setup.py
|
@ -1,7 +1,35 @@
|
|||
#!/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 = [
|
||||
Extension(
|
||||
|
@ -15,15 +43,7 @@ extensions = [
|
|||
'src/lib/ebur128',
|
||||
'src/lib/ebur128/queue',
|
||||
],
|
||||
# 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)],
|
||||
define_macros=macros,
|
||||
),
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue