Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
fakufaku committed Sep 25, 2023
2 parents 648fa0c + 68d011f commit 76b2763
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 27 deletions.
21 changes: 1 addition & 20 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,10 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
import sys
# import sys

# sys.path.insert(0, os.path.abspath('.'))

# Mock C modules
try:
from unittest.Mock import MagicMock # Python >3.3
except ImportError:
try:
from mock import MagicMock
except ImportError:
raise ImportError("No module named mock")


class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()


mock_modules = ["numpy", "samplerate._src"]
sys.modules.update((mod_name, Mock()) for mod_name in mock_modules)

import samplerate

# -- General configuration ------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import re
import subprocess
import sys
from distutils.version import LooseVersion
from pathlib import Path

import setuptools
Expand Down Expand Up @@ -65,7 +64,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item]

# In this example, we pass in the version to C++. You might not need to.
# cmake_args += [f"-DEXAMPLE_VERSION_INFO={self.distribution.get_version()}"]
cmake_args += [f"-DPACKAGE_VERSION_INFO={self.distribution.get_version()}"]

if self.compiler.compiler_type != "msvc":
# Using Ninja-build since it a) is available as a wheel and b)
Expand Down
8 changes: 3 additions & 5 deletions src/samplerate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <typeinfo>
#include <vector>

// avoids an error if we compile with raw cmake
#ifndef VERSION_INFO
#define VERSION_INFO "nightly"
#endif
Expand Down Expand Up @@ -204,7 +203,7 @@ namespace {

long the_callback_func(void *cb_data, float **data);

}; // namespace
} // namespace

class CallbackResampler {
private:
Expand All @@ -221,9 +220,8 @@ class CallbackResampler {
private:
void _create() {
int _err_num = 0;
_state =
src_callback_new(the_callback_func, _converter_type, (int)_channels,
&_err_num, static_cast<void *>(this));
_state = src_callback_new(the_callback_func, _converter_type, (int)_channels,
&_err_num, static_cast<void *>(this));
if (_state == nullptr) error_handler(_err_num);
}

Expand Down

0 comments on commit 76b2763

Please sign in to comment.