Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 56 additions & 58 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on: [push, pull_request]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -13,66 +12,65 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools setuptools_scm wheel build twine
pip install -r requirements.txt
- name: Build package
run: |
python -m pip install -e .
- name: Test with pytest
run: |
pytest
- name: Test the universal wheels
if: matrix.os == 'ubuntu-latest'
run: |
# do not build binary wheels on linux
python -m build --sdist
twine check dist/*
- name: Test the binary wheels
if: matrix.os != 'ubuntu-latest'
submodules: recursive
# - name: Checkout submodules
# shell: bash
# run: |
# auth_header="$(git config --local --get http.https://github.com/.extraheader)"
# git submodule sync --recursive
# git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Sync dependencies with uv
run: |
python -m build
twine check dist/*
- name: Publish sdist to pypi
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
uv sync --locked --all-groups --python ${{ matrix.python-version }}
- name: Build sdist
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
run: |
twine upload --skip-existing dist/*
- name: Publish bdist to pypi
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && matrix.os != 'ubuntu-latest'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
uv build --sdist
- name: Upload sdist
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
uses: actions/upload-artifact@v5
with:
name: dist-python-samplerate-ledfx
path: dist/*.tar.gz
if-no-files-found: error
- name: Build wheel for ${{ matrix.os }} Python ${{ matrix.python-version }}
run: |
twine upload --skip-existing dist/*
- name: Publish sdist to pypi-test
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/test-') && matrix.os == 'ubuntu-latest'
env:
TWINE_USERNAME: ${{ secrets.PYPITEST_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPITEST_PASSWORD }}
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
uv build --wheel
- name: Test with pytest
run: |
twine upload --skip-existing dist/*
- name: Publish bdist to pypi-test
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/test-') && matrix.os != 'ubuntu-latest'
env:
TWINE_USERNAME: ${{ secrets.PYPITEST_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPITEST_PASSWORD }}
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
uv run pytest

- name: Upload wheel
uses: actions/upload-artifact@v5
with:
name: dist-python-samplerate-ledfx-${{ matrix.os }}-py${{ matrix.python-version }}
path: dist/*.whl
if-no-files-found: error

publish:
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/python-samplerate-ledfx/
permissions:
id-token: write # Required for trusted publishing
steps:
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Download all artifacts
uses: actions/download-artifact@v5
with:
path: dist
pattern: dist-*
merge-multiple: true
- name: Display structure of downloaded files
run: ls -R dist
- name: Publish to PyPI
run: |
twine upload --skip-existing dist/*
uv publish --trusted-publishing always
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ __pycache__/
*.egg-info
dist/
build/
.venv/

docs/_build

Expand Down
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
include README.rst
include LICENSE.rst
include versioneer.py
include src/*.cpp
include CMakeLists.txt
include external/CMakeLists.txt
include requirements.txt
include uv.lock
include examples/*.py
20 changes: 16 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ requires = ["setuptools>=61", "setuptools_scm[toml]>=6.2", "cmake"]
build-backend = "setuptools.build_meta"

[project]
name="samplerate"
dynamic = ["version", "readme"]
name="samplerate-ledfx"
version = "0.2.3"
dynamic = ["readme"]
description="Monolithic python wrapper for libsamplerate based on pybind11 and NumPy"
authors=[
{"name" = "Robin Scheibler", "email" ="fakufaku@gmail.com"},
{"name" = "Tino Wagner", "email" ="ich@tinowagner.com"}
]
requires-python = ">=3.7"
requires-python = ">=3.8"
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console",
Expand All @@ -23,7 +24,18 @@ classifiers=[
]
keywords=["samplerate", "converter", "signal processing", "audio"]
license = "MIT"
dependencies = ["numpy"]
dependencies = [
"numpy>=1.7.0",

]

[dependency-groups]
dev = [
"pytest",
"pytest-asyncio",
"uvloop>=0.16.0; sys_platform != \"win32\"",
"winloop>=0.3.1; sys_platform == \"win32\" and python_version >= \"3.9\"",
]

[tool.setuptools.dynamic]
readme = {file = ["README.rst"]}
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

Loading