rubband 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. rubband-0.1.0/.DS_Store +0 -0
  2. rubband-0.1.0/.github/workflows/docs.yml +48 -0
  3. rubband-0.1.0/.github/workflows/release-builds.yml +141 -0
  4. rubband-0.1.0/.gitignore +7 -0
  5. rubband-0.1.0/.python-version +1 -0
  6. rubband-0.1.0/CMakeLists.txt +41 -0
  7. rubband-0.1.0/LICENSE +501 -0
  8. rubband-0.1.0/PKG-INFO +221 -0
  9. rubband-0.1.0/README.md +205 -0
  10. rubband-0.1.0/doc/production-plan.md +245 -0
  11. rubband-0.1.0/docs/api.md +168 -0
  12. rubband-0.1.0/docs/building.md +39 -0
  13. rubband-0.1.0/docs/index.md +65 -0
  14. rubband-0.1.0/docs/release.md +20 -0
  15. rubband-0.1.0/mkdocs.yml +45 -0
  16. rubband-0.1.0/pyproject.toml +45 -0
  17. rubband-0.1.0/rubband/__init__.py +812 -0
  18. rubband-0.1.0/rubband/_native.py +220 -0
  19. rubband-0.1.0/rubband/_rubband.cpp +373 -0
  20. rubband-0.1.0/rubband/_rubband.pyi +50 -0
  21. rubband-0.1.0/scripts/release.sh +71 -0
  22. rubband-0.1.0/scripts/smoke_wheel.py +48 -0
  23. rubband-0.1.0/tests/.DS_Store +0 -0
  24. rubband-0.1.0/tests/conftest.py +28 -0
  25. rubband-0.1.0/tests/test_api/test_stretch_accepts_one_second_mono_audio.wav +0 -0
  26. rubband-0.1.0/tests/test_api/test_stretch_accepts_one_second_stereo_audio.wav +0 -0
  27. rubband-0.1.0/tests/test_api.py +705 -0
  28. rubband-0.1.0/tests/test_native/pianolead.wav +0 -0
  29. rubband-0.1.0/tests/test_native/pianolead_pitch_down_12.wav +0 -0
  30. rubband-0.1.0/tests/test_native/pianolead_pitch_down_5.wav +0 -0
  31. rubband-0.1.0/tests/test_native/pianolead_pitch_up_12.wav +0 -0
  32. rubband-0.1.0/tests/test_native/pianolead_pitch_up_5.wav +0 -0
  33. rubband-0.1.0/tests/test_native/test_native_pitch_shift_regression.wav +0 -0
  34. rubband-0.1.0/tests/test_native/test_native_source_audio_regression.wav +0 -0
  35. rubband-0.1.0/tests/test_native/test_native_stretch_regression.wav +0 -0
  36. rubband-0.1.0/tests/test_native/test_native_stretcher_regression.wav +0 -0
  37. rubband-0.1.0/tests/test_native.py +352 -0
  38. rubband-0.1.0/tests/test_packaging.py +45 -0
  39. rubband-0.1.0/uv.lock +1387 -0
Binary file
@@ -0,0 +1,48 @@
1
+ name: Documentation
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+ id-token: write
12
+ pages: write
13
+
14
+ concurrency:
15
+ group: pages
16
+ cancel-in-progress: false
17
+
18
+ jobs:
19
+ build:
20
+ name: Build documentation
21
+ runs-on: ubuntu-22.04
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - uses: astral-sh/setup-uv@v6
27
+
28
+ - name: Install documentation dependencies
29
+ run: uv sync --all-groups --no-install-project
30
+
31
+ - name: Build documentation
32
+ run: uv run --no-sync mkdocs build --strict
33
+
34
+ - uses: actions/upload-pages-artifact@v5
35
+ with:
36
+ path: site
37
+
38
+ deploy:
39
+ name: Deploy documentation
40
+ needs: build
41
+ runs-on: ubuntu-22.04
42
+ environment:
43
+ name: github-pages
44
+ url: ${{ steps.deployment.outputs.page_url }}
45
+
46
+ steps:
47
+ - uses: actions/deploy-pages@v5
48
+ id: deployment
@@ -0,0 +1,141 @@
1
+ name: Release builds
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ validate-tag:
13
+ name: Require tag on main
14
+ runs-on: ubuntu-22.04
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 0
20
+
21
+ - name: Require tagged commit to be on main
22
+ run: |
23
+ git fetch origin main:refs/remotes/origin/main
24
+ git merge-base --is-ancestor "$GITHUB_SHA" origin/main
25
+
26
+ build:
27
+ name: Build ${{ matrix.name }}
28
+ needs: validate-tag
29
+ runs-on: ${{ matrix.os }}
30
+ env:
31
+ UV_NO_SOURCES: "1"
32
+ ARTIFACT_NAME: rubband-${{ github.ref_name }}-${{ matrix.artifact }}
33
+ strategy:
34
+ fail-fast: false
35
+ matrix:
36
+ include:
37
+ - name: macOS
38
+ os: macos-latest
39
+ artifact: macOS.tar.gz
40
+ - name: Linux
41
+ os: ubuntu-22.04
42
+ artifact: Linux.tar.gz
43
+ - name: Windows
44
+ os: windows-latest
45
+ artifact: Windows.zip
46
+
47
+ steps:
48
+ - uses: actions/checkout@v4
49
+
50
+ - uses: astral-sh/setup-uv@v6
51
+
52
+ - name: Install macOS Rubber Band
53
+ if: runner.os == 'macOS'
54
+ run: brew install rubberband pkg-config
55
+
56
+ - name: Install Linux Rubber Band
57
+ if: runner.os == 'Linux'
58
+ run: |
59
+ sudo apt-get update
60
+ sudo apt-get install -y librubberband-dev pkg-config
61
+
62
+ - name: Install Windows Rubber Band
63
+ if: runner.os == 'Windows'
64
+ shell: pwsh
65
+ run: |
66
+ vcpkg install rubberband:x64-windows
67
+ "CMAKE_ARGS=-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" | Out-File -FilePath $env:GITHUB_ENV -Append
68
+ "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
69
+
70
+ - name: Install project
71
+ run: uv sync --dev
72
+
73
+ - name: Test
74
+ run: uv run pytest
75
+
76
+ - name: Build wheel and sdist
77
+ run: uv build --sdist --wheel --out-dir dist
78
+
79
+ - name: Smoke-test wheel
80
+ shell: bash
81
+ run: |
82
+ wheel="$(find dist -maxdepth 1 -name 'rubband-*.whl' | sort | tail -n 1)"
83
+ uv run python scripts/smoke_wheel.py "$wheel"
84
+
85
+ - name: Package Unix artifacts
86
+ if: runner.os != 'Windows'
87
+ run: tar -czf "$ARTIFACT_NAME" -C dist .
88
+
89
+ - name: Package Windows artifacts
90
+ if: runner.os == 'Windows'
91
+ shell: pwsh
92
+ run: Compress-Archive -Path dist/* -DestinationPath "$env:ARTIFACT_NAME"
93
+
94
+ - name: Write Unix SHA256 checksum
95
+ if: runner.os != 'Windows'
96
+ run: shasum -a 256 "$ARTIFACT_NAME" > "$ARTIFACT_NAME.sha256"
97
+
98
+ - name: Write Windows SHA256 checksum
99
+ if: runner.os == 'Windows'
100
+ shell: pwsh
101
+ run: |
102
+ $hash = (Get-FileHash -Algorithm SHA256 "$env:ARTIFACT_NAME").Hash.ToLower()
103
+ "$hash $env:ARTIFACT_NAME" | Set-Content "$env:ARTIFACT_NAME.sha256"
104
+
105
+ - uses: actions/upload-artifact@v4
106
+ with:
107
+ name: ${{ env.ARTIFACT_NAME }}
108
+ path: |
109
+ ${{ env.ARTIFACT_NAME }}
110
+ ${{ env.ARTIFACT_NAME }}.sha256
111
+
112
+ release:
113
+ name: Publish release
114
+ needs: build
115
+ runs-on: ubuntu-22.04
116
+ if: startsWith(github.ref, 'refs/tags/')
117
+
118
+ steps:
119
+ - uses: actions/download-artifact@v4
120
+ with:
121
+ path: artifacts
122
+ merge-multiple: true
123
+
124
+ - name: Create GitHub release
125
+ env:
126
+ GH_TOKEN: ${{ github.token }}
127
+ TAG: ${{ github.ref_name }}
128
+ run: |
129
+ cat > RELEASE-NOTES.md <<EOF
130
+ ## Downloads
131
+
132
+ Each archive contains the wheel, source distribution, and checksum for one platform.
133
+
134
+ - macOS: \`rubband-$TAG-macOS.tar.gz\`
135
+ - Linux: \`rubband-$TAG-Linux.tar.gz\`
136
+ - Windows: \`rubband-$TAG-Windows.zip\`
137
+
138
+ These wheels are built against the platform Rubber Band library used in CI.
139
+ EOF
140
+ notes="$(cat RELEASE-NOTES.md)"
141
+ gh release create "$TAG" artifacts/* --repo "$GITHUB_REPOSITORY" --title "$TAG" --notes "$notes" --generate-notes
@@ -0,0 +1,7 @@
1
+ .pytest_cache/
2
+ .ruff_cache/
3
+ .venv/
4
+ dist/
5
+ site/
6
+ __pycache__/
7
+ *.py[cod]
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,41 @@
1
+ cmake_minimum_required(VERSION 3.20)
2
+
3
+ project(rubband LANGUAGES CXX)
4
+
5
+ find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
6
+ find_package(nanobind CONFIG REQUIRED)
7
+ find_package(PkgConfig QUIET)
8
+
9
+ if(PkgConfig_FOUND)
10
+ pkg_check_modules(RUBBERBAND QUIET IMPORTED_TARGET rubberband)
11
+ endif()
12
+
13
+ if(RUBBERBAND_FOUND)
14
+ set(RUBBERBAND_TARGET PkgConfig::RUBBERBAND)
15
+ else()
16
+ find_path(RUBBERBAND_INCLUDE_DIR rubberband/RubberBandStretcher.h)
17
+ find_library(RUBBERBAND_LIBRARY NAMES rubberband RubberBand)
18
+
19
+ if(NOT RUBBERBAND_INCLUDE_DIR OR NOT RUBBERBAND_LIBRARY)
20
+ message(
21
+ FATAL_ERROR
22
+ "Could not find Rubber Band. Install librubberband and make it "
23
+ "discoverable with pkg-config, CMAKE_PREFIX_PATH, or vcpkg."
24
+ )
25
+ endif()
26
+
27
+ add_library(rubberband::rubberband UNKNOWN IMPORTED)
28
+ set_target_properties(
29
+ rubberband::rubberband
30
+ PROPERTIES
31
+ IMPORTED_LOCATION "${RUBBERBAND_LIBRARY}"
32
+ INTERFACE_INCLUDE_DIRECTORIES "${RUBBERBAND_INCLUDE_DIR}"
33
+ )
34
+ set(RUBBERBAND_TARGET rubberband::rubberband)
35
+ endif()
36
+
37
+ nanobind_add_module(_rubband rubband/_rubband.cpp)
38
+ target_compile_features(_rubband PRIVATE cxx_std_17)
39
+ target_link_libraries(_rubband PRIVATE "${RUBBERBAND_TARGET}")
40
+
41
+ install(TARGETS _rubband LIBRARY DESTINATION rubband)