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
3 changes: 2 additions & 1 deletion .azure-pipelines/azure-pipelines-linux.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
cdt_name:
- cos6
- conda
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
- quay.io/condaforge/linux-anvil-x86_64:alma9
pin_run_as_build:
python:
min_pin: x.x
max_pin: x.x
python:
- 3.12.* *_cpython
python_min:
- '3.9'
4 changes: 2 additions & 2 deletions .gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 27 additions & 2 deletions azure-pipelines.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 16 additions & 5 deletions build-locally.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions conda-forge.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
compiler_stack: comp7
max_py_ver: '37'
max_r_ver: '35'
conda_build:
pkg_format: '2'
conda_forge_output_validation: true
github:
branch_name: main
tooling_branch_name: main
conda_build:
pkg_format: '2'
11 changes: 11 additions & 0 deletions recipe/cmdclass.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/setup.py b/setup.py
index f986c50..751f301 100644
--- a/setup.py
+++ b/setup.py
@@ -131,5 +131,5 @@ setup(
long_description=open('README.rst').read(),
long_description_content_type="text/x-rst",
tests_require=['pytest'],
- cmdclass=cmdclass,
+ # cmdclass=cmdclass,
)
22 changes: 17 additions & 5 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ package:

source:
fn: {{ pypi_name }}-{{ version }}.tar.gz
url: https://pypi.io/packages/source/{{ pypi_name[0] }}/{{ pypi_name }}/{{ pypi_name }}-{{ version }}.tar.gz
url: https://pypi.org/packages/source/{{ pypi_name[0] }}/{{ pypi_name }}/{{ pypi_name }}-{{ version }}.tar.gz
sha256: e8e1017b2cf1dda767aef19d2fd9ee5ebe07e050d430f77a0a7c66ba08b8cdae
patches:
# Don't use the wheel-related cmdclass patching, we need to pretend the platform
# is windows to add an appropriate CFFI function. However, doing so makes the
# wheel name and metadata indicate it's Windows-only, which is not true.
- cmdclass.patch

build:
number: 1
number: 2
noarch: python
script:
# We are currently building a noarch package, but pysoundfile contains a
Expand All @@ -26,21 +31,28 @@ build:
requirements:
host:
- pip
- python >=3.6
- python {{ python_min }}
- setuptools
- cffi
run:
- python >=3.6
- python >={{ python_min }}
- cffi
- numpy
- libsndfile >=1.2

test:
requires:
- pip
- python {{ python_min }}
imports:
- soundfile
commands:
# Verify that soundfile is linking the correct libsndfile object
python -c "import soundfile; print(soundfile._libname)"
- python -c "import soundfile; print(soundfile._libname)"
# Verify that we can actually access the library
- python -c "import soundfile as sf, pprint; fmts = sf.available_formats(); pprint.pprint(fmts); assert 'WAV' in fmts"
- pip show -vvv soundfile
- pip check -vvv


about:
Expand Down
72 changes: 72 additions & 0 deletions recipe/run_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Adapted from https://github.com/bastibe/python-soundfile/blob/master/tests/generate_soundfiles.py

import soundfile as sf
import struct


def uint32(number):
return struct.pack('<I', number)


def uint16(number):
return struct.pack('<H', number)


mono_raw = struct.pack('<5h', 0, 1, 2, -2, -1)

# floating point data is typically limited to the interval [-1.0, 1.0],
# but smaller/larger values are supported as well
stereo_raw = struct.pack('<8f',
1.75, -1.75,
1.0, -1.0,
0.5, -0.5,
0.25, -0.25)

mono_data = (
b'RIFF' +
uint32(46) + # size

b'WAVE' + # file type

b'fmt ' +
uint32(16) + # chunk size
uint16(1) + # data type (PCM)
uint16(1) + # channels
uint32(44100) + # samplerate
uint32(44100 * 2) + # bytes per second
uint16(2) + # frame size
uint16(16) + # bits per sample

b'data' +
uint32(5 * 2) + # chunk size
mono_raw
)

stereo_data = (
b'RIFF' +
uint32(80) + # size

b'WAVE' + # file type

b'fmt ' +
uint32(16) + # chunk size
uint16(3) + # data type (float)
uint16(2) + # channels
uint32(44100) + # samplerate
uint32(44100 * 2 * 4) + # bytes per second
uint16(2 * 4) + # frame size
uint16(32) + # bits per sample

b'fact' +
uint32(4) + # chunk size
uint32(4) + # number of frames

b'data' +
uint32(8 * 4) + # chunk size
stereo_raw
)

with open('stereo.wav', 'wb') as f:
f.write(stereo_data)

print(sf.info('stereo.wav'))