From 2f8bc04032a355f04488f5c9e91f80f073564a40 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Fri, 17 Nov 2017 12:49:22 +0100 Subject: Move portaudio-binaries submodule ... in order to be able to properly import _sounddevice_data, even on Python 2.x --- .gitmodules | 4 ++-- _sounddevice_data | 1 - _sounddevice_data/__init__.py | 0 _sounddevice_data/portaudio-binaries | 1 + setup.py | 5 +++-- src/sounddevice.py | 4 ++-- 6 files changed, 8 insertions(+), 7 deletions(-) delete mode 160000 _sounddevice_data create mode 100644 _sounddevice_data/__init__.py create mode 160000 _sounddevice_data/portaudio-binaries diff --git a/.gitmodules b/.gitmodules index 9010351..40506c1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "_sounddevice_data"] - path = _sounddevice_data +[submodule "portaudio-binaries"] + path = _sounddevice_data/portaudio-binaries url = https://github.com/spatialaudio/portaudio-binaries.git diff --git a/_sounddevice_data b/_sounddevice_data deleted file mode 160000 index bab7ef6..0000000 --- a/_sounddevice_data +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bab7ef6a62415c2c83bdb632585fa439d3edc48b diff --git a/_sounddevice_data/__init__.py b/_sounddevice_data/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/_sounddevice_data/portaudio-binaries b/_sounddevice_data/portaudio-binaries new file mode 160000 index 0000000..bab7ef6 --- /dev/null +++ b/_sounddevice_data/portaudio-binaries @@ -0,0 +1 @@ +Subproject commit bab7ef6a62415c2c83bdb632585fa439d3edc48b diff --git a/setup.py b/setup.py index 7af08ee..37d645a 100644 --- a/setup.py +++ b/setup.py @@ -33,9 +33,10 @@ elif system == 'Windows': else: libname = None -if libname and os.path.isdir('_sounddevice_data'): +if libname and os.path.isdir('_sounddevice_data/portaudio-binaries'): packages = ['_sounddevice_data'] - package_data = {'_sounddevice_data': [libname, 'README.md']} + package_data = {'_sounddevice_data': ['portaudio-binaries/' + libname, + 'portaudio-binaries/README.md']} package_dir['_sounddevice_data'] = '_sounddevice_data' zip_safe = False else: diff --git a/src/sounddevice.py b/src/sounddevice.py index 7ca9d43..3cf4d52 100644 --- a/src/sounddevice.py +++ b/src/sounddevice.py @@ -68,8 +68,8 @@ except OSError: else: raise import _sounddevice_data - _lib = _ffi.dlopen( - _os.path.join(next(iter(_sounddevice_data.__path__)), _libname)) + _lib = _ffi.dlopen(_os.path.join(next(iter(_sounddevice_data.__path__)), + 'portaudio-binaries', _libname)) _sampleformats = { 'float32': _lib.paFloat32, -- cgit v1.2.3